Skip to content

Commit

Permalink
chore: add webpack test build
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-scherzinger committed Apr 25, 2017
1 parent a36d1ba commit b27694b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -11,7 +11,7 @@
"typings": "./typings/index.d.ts",
"scripts": {
"release": "./release.sh $3",
"build": "npm run buildNode && npm run buildBrowser",
"build": "npm run buildNode && webpack ./src/index.js ./dist/webpack-bundle.js && npm run buildBrowser",
"buildNode": "babel src -d lib --source-maps",
"buildBrowser": "browserify lib/index.js -o dist/ec.sdk.js -s ec --global-transform [ babelify --presets [ es2015 ] ] && uglifyjs dist/ec.sdk.js --screw-ie8 --compress --mangle -o dist/ec.sdk.min.js",
"changelog": "conventional-changelog -i CHANGELOG.md -s",
Expand Down Expand Up @@ -51,6 +51,7 @@
"nock": "^9.0.13",
"sinon": "^2.1.0",
"sinon-chai": "^2.9.0",
"uglify-js": "^2.8.22"
"uglify-js": "^2.8.22",
"webpack": "^2.4.1"
}
}
36 changes: 36 additions & 0 deletions webpack.config.js
@@ -0,0 +1,36 @@
const webpack = require('webpack');
const path = require('path');

// Webpack Config
const webpackConfig = {
entry: {
main: './src/index.js',
},

output: {
publicPath: '',
path: path.resolve(__dirname, './dist'),
},

plugins: [
],

module: {
},

node: {
// global: true,
// crypto: 'empty',
// __dirname: true,
// __filename: true,
// process: true,
// setImmediate: false,
// clearImmediate: false,
fs: 'empty',
Buffer: true,
net: 'empty',
tls: 'empty',
},
};

module.exports = webpackConfig;

0 comments on commit b27694b

Please sign in to comment.