Skip to content

Commit 26a0cfe

Browse files
committed
Add webpack build
1 parent 0909d36 commit 26a0cfe

File tree

4 files changed

+3297
-29
lines changed

4 files changed

+3297
-29
lines changed

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['@babel/env', '@babel/flow'],
3+
};

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
"license": "MIT",
1212
"dependencies": {},
1313
"devDependencies": {
14+
"@babel/core": "^7.4.5",
15+
"@babel/preset-env": "^7.4.5",
16+
"@babel/preset-flow": "^7.0.0",
1417
"babel-eslint": "^10.0.2",
18+
"babel-loader": "^8.0.6",
1519
"coc.nvim": "^0.0.71",
1620
"eslint": "^5.3.0",
1721
"eslint-config-airbnb-base": "^13.1.0",
1822
"eslint-plugin-import": "^2.18.0",
19-
"flow-bin": "^0.102.0"
23+
"flow-bin": "^0.102.0",
24+
"webpack": "^4.35.0",
25+
"webpack-cli": "^3.3.5"
2026
}
2127
}

webpack.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
mode: 'production',
5+
target: 'node',
6+
entry: './src/index.js',
7+
externals: {
8+
'coc.nvim': 'commonjs coc.nvim',
9+
},
10+
module: {
11+
rules: [
12+
{
13+
test: /\.js$/,
14+
exclude: /node_modules/,
15+
use: [{ loader: 'babel-loader' }],
16+
},
17+
],
18+
},
19+
output: {
20+
path: path.join(__dirname, 'lib'),
21+
filename: 'index.js',
22+
libraryTarget: 'commonjs',
23+
},
24+
};

0 commit comments

Comments
 (0)