Update webpack config to match newest webpacker gem

This commit is contained in:
Sebastian Serth
2020-12-01 17:58:33 +01:00
parent d58b49f71f
commit f201804486
12 changed files with 142 additions and 142 deletions

View File

@ -11,6 +11,11 @@
# policy.object_src :none
# policy.script_src :self, :https
# policy.style_src :self, :https
#
# # You need to allow webpack-dev-server host as allowed origin for connect-src.
# # This can be done in Rails 5.2+ for development environment in the CSP initializer
# # config/initializers/content_security_policy.rb with a snippet like this:
# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
# # Specify URI for violation reports
# # policy.report_uri "/csp-violation-report-endpoint"

View File

@ -1,5 +1,5 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const environment = require('./environment');
const environment = require('./environment')
module.exports = environment;
module.exports = environment

View File

@ -4,9 +4,9 @@ Info for this file can be found
github.com/rails/webpacker/blob/master/docs/webpack.md
*/
const { environment } = require('@rails/webpacker');
const { merge } = require('webpack-merge');
const webpack = require('webpack');
const { environment } = require('@rails/webpacker')
const { merge } = require('webpack-merge')
const webpack = require('webpack')
// Add an additional plugin of your choosing : ProvidePlugin
environment.plugins.prepend('Provide', new webpack.ProvidePlugin({
@ -22,15 +22,15 @@ environment.plugins.prepend('Provide', new webpack.ProvidePlugin({
Sentry: '@sentry/browser',
Sortable: 'sortablejs',
})
);
)
const envConfig = module.exports = environment;
const envConfig = module.exports = environment
const aliasConfig = module.exports = {
resolve: {
alias: {
jquery: 'jquery/src/jquery',
}
}
};
}
module.exports = merge(envConfig.toWebpackConfig(), aliasConfig);
module.exports = merge(envConfig.toWebpackConfig(), aliasConfig)

View File

@ -1,5 +1,5 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
const environment = require('./environment');
const environment = require('./environment')
module.exports = environment;
module.exports = environment

View File

@ -1,5 +1,5 @@
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const environment = require('./environment');
const environment = require('./environment')
module.exports = environment;
module.exports = environment

View File

@ -6,12 +6,11 @@ default: &default
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: false
# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
resolved_paths: []
additional_paths: []
# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false
@ -52,15 +51,12 @@ development:
<<: *default
compile: true
# Verifies that versions and hashed value of the package contents in the project's package.json
check_yarn_integrity: true
# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: 0.0.0.0
host: localhost
port: 3035
public: 0.0.0.0:3035
public: localhost:3035
hmr: false
# Inline should be set to true if using HMR
inline: true
@ -69,12 +65,11 @@ development:
disable_host_check: true
use_local_ip: false
quiet: false
pretty: false
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: /node_modules/
# File Watcher might not work inside Vagrant
poll: true
ignored: '**/node_modules/**'
test: