Update webpack config to match newest webpacker gem
This commit is contained in:
1
.browserslistrc
Normal file
1
.browserslistrc
Normal file
@ -0,0 +1 @@
|
|||||||
|
defaults
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -22,9 +22,9 @@
|
|||||||
/.vagrant
|
/.vagrant
|
||||||
*.iml
|
*.iml
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
/node_modules
|
|
||||||
/public/packs
|
/public/packs
|
||||||
/public/packs-test
|
/public/packs-test
|
||||||
/node_modules
|
/node_modules
|
||||||
|
/yarn-error.log
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
|
134
babel.config.js
134
babel.config.js
@ -1,70 +1,70 @@
|
|||||||
module.exports = function(api) {
|
module.exports = function(api) {
|
||||||
var validEnv = ['development', 'test', 'production']
|
var validEnv = ['development', 'test', 'production']
|
||||||
var currentEnv = api.env()
|
var currentEnv = api.env()
|
||||||
var isDevelopmentEnv = api.env('development')
|
var isDevelopmentEnv = api.env('development')
|
||||||
var isProductionEnv = api.env('production')
|
var isProductionEnv = api.env('production')
|
||||||
var isTestEnv = api.env('test')
|
var isTestEnv = api.env('test')
|
||||||
|
|
||||||
if (!validEnv.includes(currentEnv)) {
|
if (!validEnv.includes(currentEnv)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'Please specify a valid `NODE_ENV` or ' +
|
'Please specify a valid `NODE_ENV` or ' +
|
||||||
'`BABEL_ENV` environment variables. Valid values are "development", ' +
|
'`BABEL_ENV` environment variables. Valid values are "development", ' +
|
||||||
'"test", and "production". Instead, received: ' +
|
'"test", and "production". Instead, received: ' +
|
||||||
JSON.stringify(currentEnv) +
|
JSON.stringify(currentEnv) +
|
||||||
'.'
|
'.'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
presets: [
|
presets: [
|
||||||
isTestEnv && [
|
isTestEnv && [
|
||||||
require('@babel/preset-env').default,
|
'@babel/preset-env',
|
||||||
{
|
{
|
||||||
targets: {
|
targets: {
|
||||||
node: 'current'
|
node: 'current'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
(isProductionEnv || isDevelopmentEnv) && [
|
(isProductionEnv || isDevelopmentEnv) && [
|
||||||
require('@babel/preset-env').default,
|
'@babel/preset-env',
|
||||||
{
|
{
|
||||||
forceAllTransforms: true,
|
forceAllTransforms: true,
|
||||||
useBuiltIns: 'entry',
|
useBuiltIns: 'entry',
|
||||||
modules: false,
|
corejs: 3,
|
||||||
exclude: ['transform-typeof-symbol']
|
modules: false,
|
||||||
}
|
exclude: ['transform-typeof-symbol']
|
||||||
]
|
}
|
||||||
].filter(Boolean),
|
]
|
||||||
plugins: [
|
].filter(Boolean),
|
||||||
require('babel-plugin-macros'),
|
plugins: [
|
||||||
require('@babel/plugin-syntax-dynamic-import').default,
|
'babel-plugin-macros',
|
||||||
isTestEnv && require('babel-plugin-dynamic-import-node'),
|
'@babel/plugin-syntax-dynamic-import',
|
||||||
require('@babel/plugin-transform-destructuring').default,
|
isTestEnv && 'babel-plugin-dynamic-import-node',
|
||||||
[
|
'@babel/plugin-transform-destructuring',
|
||||||
require('@babel/plugin-proposal-class-properties').default,
|
[
|
||||||
{
|
'@babel/plugin-proposal-class-properties',
|
||||||
loose: true
|
{
|
||||||
}
|
loose: true
|
||||||
],
|
}
|
||||||
[
|
],
|
||||||
require('@babel/plugin-proposal-object-rest-spread').default,
|
[
|
||||||
{
|
'@babel/plugin-proposal-object-rest-spread',
|
||||||
useBuiltIns: true
|
{
|
||||||
}
|
useBuiltIns: true
|
||||||
],
|
}
|
||||||
[
|
],
|
||||||
require('@babel/plugin-transform-runtime').default,
|
[
|
||||||
{
|
'@babel/plugin-transform-runtime',
|
||||||
helpers: false,
|
{
|
||||||
regenerator: true
|
helpers: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
require('@babel/plugin-transform-regenerator').default,
|
'@babel/plugin-transform-regenerator',
|
||||||
{
|
{
|
||||||
async: false
|
async: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
].filter(Boolean)
|
].filter(Boolean)
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
@ -11,6 +11,11 @@
|
|||||||
# policy.object_src :none
|
# policy.object_src :none
|
||||||
# policy.script_src :self, :https
|
# policy.script_src :self, :https
|
||||||
# policy.style_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
|
# # Specify URI for violation reports
|
||||||
# # policy.report_uri "/csp-violation-report-endpoint"
|
# # policy.report_uri "/csp-violation-report-endpoint"
|
||||||
|
@ -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
|
||||||
|
@ -4,9 +4,9 @@ Info for this file can be found
|
|||||||
github.com/rails/webpacker/blob/master/docs/webpack.md
|
github.com/rails/webpacker/blob/master/docs/webpack.md
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { environment } = require('@rails/webpacker');
|
const { environment } = require('@rails/webpacker')
|
||||||
const { merge } = require('webpack-merge');
|
const { merge } = require('webpack-merge')
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack')
|
||||||
|
|
||||||
// Add an additional plugin of your choosing : ProvidePlugin
|
// Add an additional plugin of your choosing : ProvidePlugin
|
||||||
environment.plugins.prepend('Provide', new webpack.ProvidePlugin({
|
environment.plugins.prepend('Provide', new webpack.ProvidePlugin({
|
||||||
@ -22,15 +22,15 @@ environment.plugins.prepend('Provide', new webpack.ProvidePlugin({
|
|||||||
Sentry: '@sentry/browser',
|
Sentry: '@sentry/browser',
|
||||||
Sortable: 'sortablejs',
|
Sortable: 'sortablejs',
|
||||||
})
|
})
|
||||||
);
|
)
|
||||||
|
|
||||||
const envConfig = module.exports = environment;
|
const envConfig = module.exports = environment
|
||||||
const aliasConfig = module.exports = {
|
const aliasConfig = module.exports = {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
jquery: 'jquery/src/jquery',
|
jquery: 'jquery/src/jquery',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = merge(envConfig.toWebpackConfig(), aliasConfig);
|
module.exports = merge(envConfig.toWebpackConfig(), aliasConfig)
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -6,12 +6,11 @@ default: &default
|
|||||||
public_root_path: public
|
public_root_path: public
|
||||||
public_output_path: packs
|
public_output_path: packs
|
||||||
cache_path: tmp/cache/webpacker
|
cache_path: tmp/cache/webpacker
|
||||||
check_yarn_integrity: false
|
|
||||||
webpack_compile_output: false
|
webpack_compile_output: false
|
||||||
|
|
||||||
# Additional paths webpack should lookup modules
|
# Additional paths webpack should lookup modules
|
||||||
# ['app/assets', 'engine/foo/app/assets']
|
# ['app/assets', 'engine/foo/app/assets']
|
||||||
resolved_paths: []
|
additional_paths: []
|
||||||
|
|
||||||
# Reload manifest.json on all requests so we reload latest compiled packs
|
# Reload manifest.json on all requests so we reload latest compiled packs
|
||||||
cache_manifest: false
|
cache_manifest: false
|
||||||
@ -52,15 +51,12 @@ development:
|
|||||||
<<: *default
|
<<: *default
|
||||||
compile: true
|
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/
|
# Reference: https://webpack.js.org/configuration/dev-server/
|
||||||
dev_server:
|
dev_server:
|
||||||
https: false
|
https: false
|
||||||
host: 0.0.0.0
|
host: localhost
|
||||||
port: 3035
|
port: 3035
|
||||||
public: 0.0.0.0:3035
|
public: localhost:3035
|
||||||
hmr: false
|
hmr: false
|
||||||
# Inline should be set to true if using HMR
|
# Inline should be set to true if using HMR
|
||||||
inline: true
|
inline: true
|
||||||
@ -69,12 +65,11 @@ development:
|
|||||||
disable_host_check: true
|
disable_host_check: true
|
||||||
use_local_ip: false
|
use_local_ip: false
|
||||||
quiet: false
|
quiet: false
|
||||||
|
pretty: false
|
||||||
headers:
|
headers:
|
||||||
'Access-Control-Allow-Origin': '*'
|
'Access-Control-Allow-Origin': '*'
|
||||||
watch_options:
|
watch_options:
|
||||||
ignored: /node_modules/
|
ignored: '**/node_modules/**'
|
||||||
# File Watcher might not work inside Vagrant
|
|
||||||
poll: true
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
"sortablejs": "^1.12.0",
|
"sortablejs": "^1.12.0",
|
||||||
"underscore": "^1.12.0",
|
"underscore": "^1.12.0",
|
||||||
"vis": "^4.21.0",
|
"vis": "^4.21.0",
|
||||||
"webpack": "^4.44.2",
|
|
||||||
"webpack-merge": "^5.4.0"
|
"webpack-merge": "^5.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
require('postcss-import'),
|
require('postcss-import'),
|
||||||
require('postcss-flexbugs-fixes'),
|
require('postcss-flexbugs-fixes'),
|
||||||
require('postcss-preset-env')({
|
require('postcss-preset-env')({
|
||||||
autoprefixer: {
|
autoprefixer: {
|
||||||
flexbox: 'no-2009'
|
flexbox: 'no-2009'
|
||||||
},
|
},
|
||||||
stage: 3
|
stage: 3
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
};
|
}
|
||||||
|
72
yarn.lock
72
yarn.lock
@ -887,55 +887,55 @@
|
|||||||
webpack-sources "^1.4.3"
|
webpack-sources "^1.4.3"
|
||||||
|
|
||||||
"@sentry/browser@^5.27.6":
|
"@sentry/browser@^5.27.6":
|
||||||
version "5.27.6"
|
version "5.28.0"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.27.6.tgz#54fe177e9986246586b0761eb38cbad1ad07ecb5"
|
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.28.0.tgz#f4c094bb97070442d95d51966a5e4dc8b92f586f"
|
||||||
integrity sha512-pqrojE2ZmLUVz7l/ogtogK0+M2pK3bigYm0fja7vG7F7kXnCAwqAHDYfkFXEvFI8WvNwH+niy28lSoV95lnm0Q==
|
integrity sha512-u1W47fgYFGWTV+RRQtNBzPZMXfR4MqCYSpuUVSpWQ+riITH7pvjG1cnBYDGT7+Q1s1wGrAL/9ElJfF795VVT9g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/core" "5.27.6"
|
"@sentry/core" "5.28.0"
|
||||||
"@sentry/types" "5.27.6"
|
"@sentry/types" "5.28.0"
|
||||||
"@sentry/utils" "5.27.6"
|
"@sentry/utils" "5.28.0"
|
||||||
tslib "^1.9.3"
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@sentry/core@5.27.6":
|
"@sentry/core@5.28.0":
|
||||||
version "5.27.6"
|
version "5.28.0"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.27.6.tgz#3ceeb58acd857f1e17d52d3087bfecb506adc1f7"
|
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.28.0.tgz#2b5ee2b76f0ccd73545eac61c3c2d72d7c76f531"
|
||||||
integrity sha512-izCS5iyc6HAfpW1AsGXLAKetx82C1Sq1siAh97tOlSK58PVJAEH/WMiej9WuZJxCDTOtj94QtoLflssrZyAtFg==
|
integrity sha512-hLAUFauqX+v/ap8ATJFdp392ZvfFoR0Gb4pyRkzOeWWs5ZYuqyb9Dsjtwsb61HH/XHQGW/BKZJR2dgIjQq4JGA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/hub" "5.27.6"
|
"@sentry/hub" "5.28.0"
|
||||||
"@sentry/minimal" "5.27.6"
|
"@sentry/minimal" "5.28.0"
|
||||||
"@sentry/types" "5.27.6"
|
"@sentry/types" "5.28.0"
|
||||||
"@sentry/utils" "5.27.6"
|
"@sentry/utils" "5.28.0"
|
||||||
tslib "^1.9.3"
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@sentry/hub@5.27.6":
|
"@sentry/hub@5.28.0":
|
||||||
version "5.27.6"
|
version "5.28.0"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.27.6.tgz#a94adbe32c45dda7ad5adf742b82e0a022eb9c2f"
|
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.28.0.tgz#6a00b1011c0492b6acbaf0e24961fbd1c7edd1c1"
|
||||||
integrity sha512-bOMky3iu7zEghSaWmTayfme5tCpUok841qDCGxGKuyAtOhBDsgGNS/ApNEEDF2fyX0oo4G1cHYPWhX90ZFf/xA==
|
integrity sha512-1k19yJJcKoHbw12FET35t0m86lx/X6eJ6r4qM13eb2WN/OpoFtsgs1IjQOhGFL3OfVMcfh800Lc57ga04RLjLA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/types" "5.27.6"
|
"@sentry/types" "5.28.0"
|
||||||
"@sentry/utils" "5.27.6"
|
"@sentry/utils" "5.28.0"
|
||||||
tslib "^1.9.3"
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@sentry/minimal@5.27.6":
|
"@sentry/minimal@5.28.0":
|
||||||
version "5.27.6"
|
version "5.28.0"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.27.6.tgz#783012ed94668be168f2b521e0ea6295c76ce2b0"
|
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.28.0.tgz#bfa63f5961988e6652207c77b3ea46d89f2d52bf"
|
||||||
integrity sha512-pKhzVQX9nL4m1dcnb2i2Y47IWVNs+K3wiYLgCB9hl9+ApxppfOc+fquiFoCloST3IuaD4yly2TtbOJgAMWcMxQ==
|
integrity sha512-HzFrJx0xe5KETEZc7RxlH+1TfmH3q8w35ILOP5HGvk3+lG1DR25wHbMFmuUqNqVXrl26t0z32UBI30G1MxmTfA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/hub" "5.27.6"
|
"@sentry/hub" "5.28.0"
|
||||||
"@sentry/types" "5.27.6"
|
"@sentry/types" "5.28.0"
|
||||||
tslib "^1.9.3"
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@sentry/types@5.27.6":
|
"@sentry/types@5.28.0":
|
||||||
version "5.27.6"
|
version "5.28.0"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.27.6.tgz#b5054eafcb8ac11d4bc4787c7bc7fc113cad8b80"
|
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.28.0.tgz#242131fef910bded53350a36ffd7df240cfb8dcf"
|
||||||
integrity sha512-XOW9W8DrMk++4Hk7gWi9o5VR0o/GrqGfTKyFsHSIjqt2hL6kiMPvKeb2Hhmp7Iq37N2bDmRdWpM5m+68S2Jk6w==
|
integrity sha512-nNhoZEXdqM2xivxJBrLhxtJ2+s6FfKXUw5yBf0Jf/RBrBnH5fggPNImmyfpOoysl72igWcMWk4nnfyP5iDrriQ==
|
||||||
|
|
||||||
"@sentry/utils@5.27.6":
|
"@sentry/utils@5.28.0":
|
||||||
version "5.27.6"
|
version "5.28.0"
|
||||||
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.27.6.tgz#cd8486469ae9716a21a4bc7e828e5aeee0ed9727"
|
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.28.0.tgz#a30e36afd7094ced8d585c9fde2df2636cca6cf5"
|
||||||
integrity sha512-/QMVLv+zrTfiIj2PU+SodSbSzD5MmamMOaljkDsRIVsj6gpkm1/VG1g2+40TZ0FbQ4hCW2F+iR7cnqzZBNmchA==
|
integrity sha512-LW+ReVw9JG6g8Bvp2I1ThMDPATlisvkde+1WykxGqRhu2YIO+PvWhnoFhr9RD0ia3rYVlJkgkuTshMbPJ8HVwA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sentry/types" "5.27.6"
|
"@sentry/types" "5.28.0"
|
||||||
tslib "^1.9.3"
|
tslib "^1.9.3"
|
||||||
|
|
||||||
"@types/glob@^7.1.1":
|
"@types/glob@^7.1.1":
|
||||||
@ -7862,7 +7862,7 @@ webpack-sources@^1.0.0, webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-
|
|||||||
source-list-map "^2.0.0"
|
source-list-map "^2.0.0"
|
||||||
source-map "~0.6.1"
|
source-map "~0.6.1"
|
||||||
|
|
||||||
webpack@^4.44.1, webpack@^4.44.2:
|
webpack@^4.44.1:
|
||||||
version "4.44.2"
|
version "4.44.2"
|
||||||
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.44.2.tgz#6bfe2b0af055c8b2d1e90ed2cd9363f841266b72"
|
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.44.2.tgz#6bfe2b0af055c8b2d1e90ed2cd9363f841266b72"
|
||||||
integrity sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==
|
integrity sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==
|
||||||
|
Reference in New Issue
Block a user