I am having some trouble with using Webpack on my Ruby on Rails project. I am following the tutorial series on WebCrunch (https://web-crunch.com/lets-build-with-ruby-on-rails-project-management-app/). When I try run webpack-dev-server I receive the following error:
No configuration file found and no entry configured via CLI option. When using the CLI you need to provide at least two arguments: entry and output. A configuration file could be named 'webpack.config.js' in the current directory. Use --help to display the CLI options.
So instead I run webpack-dev-server --config config/webpacker.yml and I receive this error:
Configuration file found but no entry configured. Use --help to display the CLI options.
Attached is my webpacker.yml file and also my package.json. I am also going to attach a screenshot of the project directory.
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_output_path: packs
cache_path: tmp/cache/webpacker
# 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
extensions:
- .coffee
- .erb
- .js
- .jsx
- .ts
- .vue
- .sass
- .scss
- .css
- .png
- .svg
- .gif
- .jpeg
- .jpg
development:
<<: *default
compile: 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
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
# Cache manifest.json for performance
cache_manifest: true
package.json
{
"name": "Groupie",
"private": true,
"dependencies": {
"@rails/webpacker": "^3.2.0",
"coffeescript": "1.12.7",
"require-yaml": "0.0.1",
"rvm": "^0.3.2",
"vue": "^2.6.10",
"vue-loader": "^15.7.0",
"vue-template-compiler": "^2.6.10",
"webpack": "^2.2.0",
"webpack-dev-server": "^2.10.1"
},
"devDependencies": {}
}
Aucun commentaire:
Enregistrer un commentaire