Revert "Merge pull request #6787 from tchak/use-vite"
This reverts commit5d572727b5
, reversing changes made to43be4482ee
.
This commit is contained in:
parent
8ec7b48757
commit
44c64669e9
38 changed files with 4040 additions and 657 deletions
5
config/webpack/development.js
Normal file
5
config/webpack/development.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
|
||||
const environment = require('./environment');
|
||||
|
||||
module.exports = environment.toWebpackConfig();
|
34
config/webpack/environment.js
Normal file
34
config/webpack/environment.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
const path = require('path');
|
||||
const { environment } = require('@rails/webpacker');
|
||||
|
||||
const resolve = {
|
||||
alias: {
|
||||
'@utils': path.resolve(__dirname, '..', '..', 'app/javascript/shared/utils')
|
||||
}
|
||||
};
|
||||
|
||||
environment.splitChunks();
|
||||
environment.config.merge({ resolve });
|
||||
|
||||
// Excluding node_modules From Being Transpiled By Babel-Loader
|
||||
// One change to take into consideration,
|
||||
// is that Webpacker 4 transpiles the node_modules folder with the babel-loader.
|
||||
// This folder used to be ignored by Webpacker 3.
|
||||
// The new behavior helps in case some library contains ES6 code, but in some cases it can lead to issues.
|
||||
// To avoid running babel-loader in the node_modules folder, replicating the same behavior as Webpacker 3,
|
||||
// we added the following code:
|
||||
|
||||
const nodeModulesLoader = environment.loaders.get('nodeModules');
|
||||
if (!Array.isArray(nodeModulesLoader.exclude)) {
|
||||
nodeModulesLoader.exclude =
|
||||
nodeModulesLoader.exclude == null ? [] : [nodeModulesLoader.exclude];
|
||||
}
|
||||
nodeModulesLoader.exclude.push(
|
||||
path.resolve(__dirname, '..', '..', 'node_modules/maplibre-gl')
|
||||
);
|
||||
|
||||
// Uncoment next lines to run webpack-bundle-analyzer
|
||||
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
// environment.plugins.append('BundleAnalyzer', new BundleAnalyzerPlugin());
|
||||
|
||||
module.exports = environment;
|
5
config/webpack/production.js
Normal file
5
config/webpack/production.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
|
||||
|
||||
const environment = require('./environment');
|
||||
|
||||
module.exports = environment.toWebpackConfig();
|
5
config/webpack/test.js
Normal file
5
config/webpack/test.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
|
||||
const environment = require('./environment');
|
||||
|
||||
module.exports = environment.toWebpackConfig();
|
Loading…
Add table
Add a link
Reference in a new issue