aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack
diff options
context:
space:
mode:
Diffstat (limited to 'config/webpack')
-rw-r--r--config/webpack/dev.js14
-rw-r--r--config/webpack/development.js3
-rw-r--r--config/webpack/environment.js27
-rw-r--r--config/webpack/production.js14
-rw-r--r--config/webpack/staging.js14
-rw-r--r--config/webpack/test.js8
6 files changed, 80 insertions, 0 deletions
diff --git a/config/webpack/dev.js b/config/webpack/dev.js
new file mode 100644
index 000000000..7703f8452
--- /dev/null
+++ b/config/webpack/dev.js
@@ -0,0 +1,14 @@
+const environment = require('./environment')
+const webpack = require('webpack')
+const UglifyJsPlugin = require('uglify-js')
+
+environment.plugins.set(
+ 'UglifyJs',
+ new webpack.optimize.UglifyJsPlugin({
+ compress: {
+ warnings: false
+ }
+ })
+)
+
+module.exports = environment.toWebpackConfig()
diff --git a/config/webpack/development.js b/config/webpack/development.js
new file mode 100644
index 000000000..b66885a3c
--- /dev/null
+++ b/config/webpack/development.js
@@ -0,0 +1,3 @@
+const environment = require('./environment')
+
+module.exports = environment.toWebpackConfig() \ No newline at end of file
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
new file mode 100644
index 000000000..e7c879fb9
--- /dev/null
+++ b/config/webpack/environment.js
@@ -0,0 +1,27 @@
+const { environment } = require('@rails/webpacker')
+const CleanWebpackPlugin = require('clean-webpack-plugin')
+
+let pathsToClean = [
+ 'public/packs'
+];
+
+// the clean options to use
+let cleanOptions = {
+ root: __dirname + '/../../',
+ verbose: true,
+ dry: false
+};
+
+
+environment.plugins.set(
+ 'CleanWebpack',
+ new CleanWebpackPlugin(pathsToClean, cleanOptions)
+)
+
+// const config = environment.toWebpackConfig()
+
+// config.resolve.alias = {
+// jquery: "jquery/src/jquery",
+// }
+
+module.exports = environment
diff --git a/config/webpack/production.js b/config/webpack/production.js
new file mode 100644
index 000000000..7703f8452
--- /dev/null
+++ b/config/webpack/production.js
@@ -0,0 +1,14 @@
+const environment = require('./environment')
+const webpack = require('webpack')
+const UglifyJsPlugin = require('uglify-js')
+
+environment.plugins.set(
+ 'UglifyJs',
+ new webpack.optimize.UglifyJsPlugin({
+ compress: {
+ warnings: false
+ }
+ })
+)
+
+module.exports = environment.toWebpackConfig()
diff --git a/config/webpack/staging.js b/config/webpack/staging.js
new file mode 100644
index 000000000..7703f8452
--- /dev/null
+++ b/config/webpack/staging.js
@@ -0,0 +1,14 @@
+const environment = require('./environment')
+const webpack = require('webpack')
+const UglifyJsPlugin = require('uglify-js')
+
+environment.plugins.set(
+ 'UglifyJs',
+ new webpack.optimize.UglifyJsPlugin({
+ compress: {
+ warnings: false
+ }
+ })
+)
+
+module.exports = environment.toWebpackConfig()
diff --git a/config/webpack/test.js b/config/webpack/test.js
new file mode 100644
index 000000000..d728f40d2
--- /dev/null
+++ b/config/webpack/test.js
@@ -0,0 +1,8 @@
+const environment = require('./environment')
+
+import $ from 'jquery';
+global.$ = global.jQuery = $;
+
+require('bootstrap')
+
+module.exports = environment.toWebpackConfig()