summaryrefslogtreecommitdiff
path: root/src/leap/bitmask_js/webpack.config.js
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-08-26 21:09:53 -0700
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-01 01:41:24 -0400
commit62f069ef0af1444089a4d477f05ac7279897fa32 (patch)
treebde623ee4ec8de240ed5504d3cdbc01c5d6755fc /src/leap/bitmask_js/webpack.config.js
parent50a258d45e851a865801da9d888037b5869a3489 (diff)
[feat] added initial bitmask_js (WIP)
Diffstat (limited to 'src/leap/bitmask_js/webpack.config.js')
-rw-r--r--src/leap/bitmask_js/webpack.config.js77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/leap/bitmask_js/webpack.config.js b/src/leap/bitmask_js/webpack.config.js
new file mode 100644
index 0000000..7b46e1b
--- /dev/null
+++ b/src/leap/bitmask_js/webpack.config.js
@@ -0,0 +1,77 @@
+var path = require('path')
+var webpack = require('webpack')
+var CopyWebpackPlugin = require('copy-webpack-plugin');
+
+var config = {
+ context: path.join(__dirname, 'app'),
+ entry: './main.js',
+ output: {
+ path: path.join(__dirname, 'public'),
+ filename: 'app.bundle.js'
+ },
+ resolve: {
+ modulesDirectories: ['node_modules', './app'],
+ extensions: ['', '.js', '.jsx']
+ },
+ module: {
+ loaders: [
+ // babel transform
+ {
+ test: /\.js$/,
+ loader: 'babel-loader',
+ exclude: /node_modules/,
+ query: {
+ presets: ['react', 'es2015']
+ }
+ },
+ {
+ test: /\.css$/,
+ loader: "style!css"
+ },
+ {
+ test: /\.less$/,
+ loader: "style!css!less?noIeCompat"
+ }
+ ]
+ },
+ plugins: [
+ // don't bundle when there is an error:
+ new webpack.NoErrorsPlugin(),
+
+ // https://webpack.github.io/docs/code-splitting.html
+ // new webpack.optimize.CommonChunkPlugin('common.js')
+
+ // https://github.com/kevlened/copy-webpack-plugin
+ new CopyWebpackPlugin([
+ { from: 'css/*.css' },
+ { from: 'img/*'},
+ { from: 'index.html' },
+ { from: '../node_modules/bootstrap/dist/css/bootstrap.min.css', to: 'css' },
+ { from: '../node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2', to: 'fonts' },
+ { from: '../node_modules/zxcvbn/dist/zxcvbn.js', to: 'js' }
+ ])
+ ],
+ stats: {
+ colors: true
+ },
+ // source-map can be used in production or development
+ // but it creates a separate file.
+ devtool: 'source-map'
+}
+
+/*
+if (process.env.NODE_ENV == 'production') {
+ // see https://github.com/webpack/docs/wiki/optimization
+ config.plugins.push(
+ new webpack.optimize.UglifyJsPlugin({
+ compress: { warnings: false },
+ output: { comments: false }
+ }),
+ new webpack.optimize.DedupePlugin()
+ )
+} else {
+ config.devtool = 'inline-source-map';
+}
+*/
+
+module.exports = config