8000 feat(build): add UMD build for browser support · safareli/free@e6d8131 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit e6d8131

Browse files
committed
feat(build): add UMD build for browser support
add umd build files with source maps and minified version
1 parent a713c65 commit e6d8131

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

package.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
"check": "npm run lint && npm run test",
1010
"commit": "git-cz",
1111
"prebuild": "rimraf dist",
12-
"build": "babel --out-dir dist src",
12+
"build": "run-p build:*",
13+
"build:main": "babel --out-dir dist src",
14+
"build:umd": "webpack --output-filename free.umd.js",
15+
"build:umd.min": "webpack --output-filename free.umd.min.js -p",
1316
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
1417
},
1518
"repository": {
@@ -38,7 +41,9 @@
3841
},
3942
"devDependencies": {
4043
"babel-cli": "6.10.1",
44+
"babel-core": "6.10.4",
4145
"babel-eslint": "6.1.0",
46+
"babel-loader": "6.2.4",
4247
"babel-preset-es2015": "6.9.0",
4348
"babel-preset-stage-2": "6.11.0",
4449
"commitizen": "2.8.2",
@@ -49,12 +54,17 @@
4954
"eslint-plugin-standard": "1.3.2",
5055
"fantasy-identities": "0.0.1",
5156
"ghooks": "1.3.0",
57+
"npm-run-all": "2.3.0",
5258
"rimraf": "2.5.3",
5359
"semantic-release": "^4.3.5",
54-
"tape": "4.6.0"
60+
"tape": "4.6.0",
61+
"webpack": "1.13.1"
5562
},
5663
"babel": {
57-
"presets": ["es2015", "stage-2"]
64+
"presets": [
65+
"es2015",
66+
"stage-2"
67+
]
5868
},
5969
"config": {
6070
"commitizen": {

webpack.config.babel.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {join} from 'path'
2+
3+
const include = join(__dirname, 'src')
4+
5+
export default {
6+
entry: './src/free',
7+
output: {
8+
path: join(__dirname, 'dist'),
9+
libraryTarget: 'umd',
10+
library: 'Free',
11+
},
12+
devtool: 'source-map',
13+
module: {
14+
loaders: [
15+
{test: /\.js$/, loader: 'babel', include},
16+
]
17+
}
18+
}

0 commit comments

Comments
 (0)
0