Fix JS and JS-based image upload
This commit is contained in:
parent
36984ff1d4
commit
fa8a7fc77a
6 changed files with 95 additions and 51 deletions
7
config/importmap.rb
Normal file
7
config/importmap.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Pin npm packages by running ./bin/importmap
|
||||
|
||||
pin 'application'
|
||||
pin '@hotwired/turbo-rails', to: 'turbo.min.js'
|
||||
pin '@hotwired/stimulus', to: 'stimulus.min.js'
|
||||
pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js'
|
||||
pin_all_from 'app/javascript/controllers', under: 'controllers'
|
||||
21
config/webpack/webpack.config.js
Normal file
21
config/webpack/webpack.config.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const path = require("path")
|
||||
const webpack = require("webpack")
|
||||
|
||||
module.exports = {
|
||||
mode: "production",
|
||||
devtool: "source-map",
|
||||
entry: {
|
||||
application: "./app/javascript/application.js"
|
||||
},
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
sourceMapFilename: "[file].map",
|
||||
chunkFormat: "module",
|
||||
path: path.resolve(__dirname, '..', '..', 'app/assets/builds')
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.LimitChunkCountPlugin({
|
||||
maxChunks: 1
|
||||
})
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue