Skip to content

Commit

Permalink
add new publish logic
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Jun 17, 2019
1 parent cf652c9 commit 37d486b
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
17 changes: 17 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/sh

set -e
[ "$TRACE" ] && set -x

version=$(json version < package.json)
git add .
git commit -a -m "Release $version"
git tag -a "$version" -m "Release $version"
git push --tags
git push
mkdir -p .release/lib/server
cp -r Readme.md .release
cat package.json | json -e 'this.dependencies={};this.scripts={}' > .release/package.json
webpack --config webpack.config.js
webpack --config webpack.server.config.js
cd .release && npm publish
24 changes: 24 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const path = require('path')

module.exports = {
entry: './lib/index',
target: 'node',
mode: 'none',
resolve: {
mainFields: ['module', 'main'],
extensions: ['.js']
},
externals: {
'coc.nvim': 'commonjs coc.nvim'
},
output: {
path: path.resolve(__dirname, '.release/lib'),
filename: 'index.js',
libraryTarget: "commonjs",
},
plugins: [
],
node: {
__dirname: false
}
}
17 changes: 17 additions & 0 deletions webpack.server.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const path = require('path')

module.exports = {
entry: './lib/server/cssServerMain',
target: 'node',
mode: 'none',
output: {
path: path.resolve(__dirname, '.release/lib/server'),
filename: 'cssServerMain.js'
},
plugins: [
],
node: {
__filename: false,
__dirname: false
}
}

0 comments on commit 37d486b

Please sign in to comment.