如何解决Webpacker::Manifest::MissingEntryError 当 stylesheet_packs_with_chunks_tag
我在使 = stylesheet_packs_with_chunks_tag('application',media: 'all')
在我的开发环境中工作时遇到问题。
如果我使用普通的 javascript_pack_tag
它可以工作但不使用块。
这是我的webpacker.yml
# Note: You must restart bin/webpack-dev-server for changes to take effect
default: &default
source_path: app/javascript
source_entry_path: packs
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: true
# Additional paths webpack should lookup modules
# ['app/assets','engine/foo/app/assets']
resolved_paths: []
# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false
# Extract and emit a css file
extract_css: true
static_assets_extensions:
- .jpg
- .jpeg
- .png
- .gif
- .tiff
- .ico
- .svg
- .eot
- .otf
- .ttf
- .woff
- .woff2
- .cur
extensions:
- .mjs
- .js
- .sass
- .scss
- .css
- .module.sass
- .module.scss
- .module.css
- .png
- .svg
- .gif
- .jpeg
- .jpg
- .cur
development:
<<: *default
compile: true
# Verifies that correct packages and versions are installed by inspecting package.json,yarn.lock,and node_modules
check_yarn_integrity: true
# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
hmr: false
# Inline should be set to true if using HMR
inline: true
overlay: true
compress: true
disable_host_check: true
use_local_ip: false
quiet: false
pretty: false
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: '**/node_modules/**'
test:
<<: *default
compile: true
# Compile test packs to a separate directory
public_output_path: packs-test
production:
<<: *default
# Production depends on precompilation of packs prior to booting for performance.
compile: false
# Extract and emit a css file
extract_css: true
# Cache manifest.json for performance
cache_manifest: true
package.json
{
"name": "rukiasites","private": true,"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0","@rails/ujs": "^6.0.2-2","@rails/webpacker": "4.2.2","bootstrap": "^4.4.1","bootstrap-datepicker": "^1.9.0","easy-autocomplete": "^1.3.5","jquery": "3.4.1","jquery-parallax.js": "^1.5.0","popper.js": "^1.16.1"
},"devDependencies": {
"webpack-dev-server": "^3.10.3"
}
}
environment.js
const { environment } = require('@rails/webpacker')
const webpack = require('webpack')
const customConfig = require('./custom')
environment.config.merge(customConfig)
environment.plugins.prepend('Provide',new webpack.ProvidePlugin({
$: 'jquery',jQuery: 'jquery'
})
)
environment.splitChunks()
module.exports = environment
development.js
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
const environment = require('./environment')
module.exports = environment.toWebpackConfig()
Yarn 安装成功,以及通过 webpack-dev-server
编译。 /public/packs
和 manifest.json
不为空。我正在尝试运行现有的应用程序,这就是我无法将版本升级到最新版本的原因。当前版本或设置在其他版本上运行良好。我错过了什么吗?
编辑:顺便说一句,Rails 版本是 6.0.2.2,Node v 是 v8.17.0,Yarn 是 1.22.4
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。