diff --git a/webpack.dev.config.js b/webpack.dev.config.js new file mode 100644 index 0000000..d213cd4 --- /dev/null +++ b/webpack.dev.config.js @@ -0,0 +1,33 @@ +const webpack = require('webpack') + +module.exports = { + devtool: 'cheap-module-eval-source-map', + module: { + loaders: [ + { + test: /\.js$/, + loaders: ['babel-loader'], + exclude: /node_modules/ + } + ] + }, + output: { + library: 'KerasJS', + libraryTarget: 'umd' + }, + resolve: { + extensions: ['', '.js'] + }, + plugins: [ + new webpack.optimize.OccurenceOrderPlugin(), + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production') + }), + new webpack.optimize.UglifyJsPlugin({ + compressor: { + screw_ie8: true, + warnings: false + } + }) + ] +} diff --git a/webpack.prod.config.js b/webpack.prod.config.js new file mode 100644 index 0000000..d849723 --- /dev/null +++ b/webpack.prod.config.js @@ -0,0 +1,34 @@ +const webpack = require('webpack') + +module.exports = { + module: { + loaders: [ + { + test: /\.js$/, + loaders: ['babel-loader'], + exclude: /node_modules/ + } + ] + }, + output: { + library: 'KerasJS', + libraryTarget: 'umd' + }, + resolve: { + extensions: ['', '.js'] + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify('production') + } + }), + new webpack.optimize.DedupePlugin(), + new webpack.optimize.OccurenceOrderPlugin(), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + } + }) + ] +}