mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
Switch from webpacker to (css|js)bundling-rails (#227)
* Install jsbundling-rails, uninstall rails/webpacker * Remove outdated step from run-tests workflow * Use cssbundling-rails for CSS
This commit is contained in:
committed by
GitHub
parent
e79d550070
commit
d8cf46c351
53
config/webpack/webpack.config.js
Normal file
53
config/webpack/webpack.config.js
Normal file
@@ -0,0 +1,53 @@
|
||||
const path = require("path")
|
||||
const webpack = require("webpack")
|
||||
|
||||
const mode = process.env.NODE_ENV === 'development' ? 'development' : 'production';
|
||||
|
||||
module.exports = {
|
||||
mode: mode,
|
||||
|
||||
optimization: {
|
||||
moduleIds: 'deterministic',
|
||||
},
|
||||
entry: {
|
||||
application: "./app/javascript/application.js"
|
||||
},
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
sourceMapFilename: "[file].map",
|
||||
path: path.resolve(__dirname, "..", "..", "app/assets/builds"),
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx|ts|tsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: ['babel-loader']
|
||||
},
|
||||
{
|
||||
test: /\.erb$/,
|
||||
enforce: 'pre',
|
||||
exclude: /node_modules/,
|
||||
use: [{
|
||||
loader: 'rails-erb-loader',
|
||||
options: {
|
||||
runner: (/^win/.test(process.platform) ? 'ruby ' : '') + 'bin/rails runner'
|
||||
}
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.LimitChunkCountPlugin({
|
||||
maxChunks: 1
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
$: 'jquery',
|
||||
jQuery: 'jquery',
|
||||
Popper: ['popper.js', 'default']
|
||||
})
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user