Skip to content

Commit

Permalink
feat: use webpack to build
Browse files Browse the repository at this point in the history
1. use webpack to build 2. remove async/await

#17
  • Loading branch information
chenquincy committed May 19, 2019
1 parent 285b9af commit a6c3d6d
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 34,529 deletions.
5 changes: 2 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"]
}
"presets": ["@babel/preset-env"]
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules/
packages/
build/
src/
package-lock.json
yarn.lock
yarn-error.log
16 changes: 16 additions & 0 deletions build/browser.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const path = require('path')

module.exports = [
{
mode: 'production',
entry: './lib/index.js',
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'app-info-parser.js',
library: 'AppInfoParser'
},
node: {
fs: 'empty'
}
}
]
50 changes: 50 additions & 0 deletions build/npm.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const path = require('path')

module.exports = [
{
mode: 'production',
entry: './lib/index.js',
output: {
path: path.resolve(__dirname, '../src'),
filename: 'index.js',
library: 'AppInfoParser',
libraryTarget: 'umd'
},
module: {
rules: [
{
test: /\.js$/,
use:{
loader: 'babel-loader',
},
exclude: /node_modules/
}
]
},
externals: {
bytebuffer: {
commonjs: 'bytebuffer',
commonjs2: 'bytebuffer',
amd: 'bytebuffer'
},
'cgbi-to-png': {
commonjs: 'cgbi-to-png',
commonjs2: 'cgbi-to-png',
amd: 'cgbi-to-png'
},
'isomorphic-unzip': {
commonjs: 'isomorphic-unzip',
commonjs2: 'isomorphic-unzip',
amd: 'isomorphic-unzip'
},
plist: {
commonjs: 'plist',
commonjs2: 'plist',
amd: 'plist'
}
},
node: {
fs: 'empty'
}
}
]
Loading

0 comments on commit a6c3d6d

Please sign in to comment.