aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack
diff options
context:
space:
mode:
Diffstat (limited to 'config/webpack')
-rw-r--r--config/webpack/dev.js12
-rw-r--r--config/webpack/development.js3
-rw-r--r--config/webpack/environment.js36
-rw-r--r--config/webpack/production.js12
-rw-r--r--config/webpack/staging.js12
-rw-r--r--config/webpack/test.js3
6 files changed, 78 insertions, 0 deletions
diff --git a/config/webpack/dev.js b/config/webpack/dev.js
new file mode 100644
index 000000000..97b6a77ff
--- /dev/null
+++ b/config/webpack/dev.js
@@ -0,0 +1,12 @@
+const environment = require('./environment')
+
+environment.plugins.set(
+ 'UglifyJs',
+ new webpack.optimize.UglifyJsPlugin({
+ compress: {
+ warnings: false
+ }
+ })
+)
+
+module.exports = environment.toWebpackConfig() \ No newline at end of file
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..ae1deb610
--- /dev/null
+++ b/config/webpack/environment.js
@@ -0,0 +1,36 @@
+const { environment } = require('@rails/webpacker')
+const webpack = require('webpack')
+const UglifyJsPlugin = require('uglify-js')
+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)
+)
+
+// environment.plugins.set('Provide', new webpack.ProvidePlugin({
+// $: 'jquery',
+// jQuery: 'jquery',
+// jquery: 'jquery'
+// })
+// )
+
+// const config = environment.toWebpackConfig()
+
+// config.resolve.alias = {
+// jquery: "jquery/src/jquery",
+// }
+
+module.exports = environment \ No newline at end of file
diff --git a/config/webpack/production.js b/config/webpack/production.js
new file mode 100644
index 000000000..97b6a77ff
--- /dev/null
+++ b/config/webpack/production.js
@@ -0,0 +1,12 @@
+const environment = require('./environment')
+
+environment.plugins.set(
+ 'UglifyJs',
+ new webpack.optimize.UglifyJsPlugin({
+ compress: {
+ warnings: false
+ }
+ })
+)
+
+module.exports = environment.toWebpackConfig() \ No newline at end of file
diff --git a/config/webpack/staging.js b/config/webpack/staging.js
new file mode 100644
index 000000000..97b6a77ff
--- /dev/null
+++ b/config/webpack/staging.js
@@ -0,0 +1,12 @@
+const environment = require('./environment')
+
+environment.plugins.set(
+ 'UglifyJs',
+ new webpack.optimize.UglifyJsPlugin({
+ compress: {
+ warnings: false
+ }
+ })
+)
+
+module.exports = environment.toWebpackConfig() \ No newline at end of file
diff --git a/config/webpack/test.js b/config/webpack/test.js
new file mode 100644
index 000000000..81269f651
--- /dev/null
+++ b/config/webpack/test.js
@@ -0,0 +1,3 @@
+const environment = require('./environment')
+
+module.exports = environment.toWebpackConfig()