summaryrefslogtreecommitdiff
path: root/ui/webpack.config.js
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-09-16 14:02:32 -0700
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-22 11:40:11 -0400
commit073393af311d36c8ca7570ff0d3f0a3117c0b544 (patch)
treee59286ac350ba17110392f53b6e48bcedfd12ef1 /ui/webpack.config.js
parentae5a20d059209f2027c05820dc3b4cfe7346c8a8 (diff)
[pkg] rename www to ui
Diffstat (limited to 'ui/webpack.config.js')
-rw-r--r--ui/webpack.config.js84
1 files changed, 84 insertions, 0 deletions
diff --git a/ui/webpack.config.js b/ui/webpack.config.js
new file mode 100644
index 0000000..c0f8d19
--- /dev/null
+++ b/ui/webpack.config.js
@@ -0,0 +1,84 @@
+var path = require('path')
+var webpack = require('webpack')
+var CopyWebpackPlugin = require('copy-webpack-plugin');
+
+var config = {
+ context: path.join(__dirname, 'app'),
+ entry: ['babel-polyfill', './main.js'],
+ output: {
+ path: path.join(__dirname, 'pydist', 'bitmask_js', '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')
+
+ //
+ // ASSETS
+ //
+ // If you make changes to the asset files, you will need to stop then rerun
+ // `npm run watch` for the changes to take effect.
+ //
+ // For more information: 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.woff', 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