Webpack alias resolvers via configureWebpack and chainWebpack in gridsome config don't work
See original GitHub issueSteps to reproduce
- Create a new gridsome project
- Import
path
and add the lines below to thegridsome.config.js
file
configureWebpack: {
resolve: {
alias: {
'@saucedrip': path.resolve('../literal-sauce-drip/'),
}
}
}
- Start the project with
gridsome develop
Expected result
The aliases should be recognised and everything should work fine.
Actual result
Gridsome yells errors saying “These dependencies were not found… To install them, you can run: npm install…”.
NOTE: I get the same result when I try to use chainWebpack
to merge the config objects or assign properties to the config.resolve.alias
object directly.
Environment
Libs:
- gridsome version: 0.7.3
- @gridsome/cli version: 0.2.1
For Tooling issues:
- Node version: 11.12.0
- Platform: Mac
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Project configuration - Gridsome
Gridsome requires gridsome.config.js to work. Plugins and project settings are located here. A basic configuration file would look something like this:
Read more >Webpack resolve.alias does not work with typescript?
This solved my problem: we were using a custom module syntax which defined aliases to files other than index . Renaming the files...
Read more >Webpack aliases defined in vue.config.js are not recognized
What steps will reproduce the issue? Configure Vue CLI project with aliases ( @ for source root for exmple); Open a file that...
Read more >gridsome @ 0.5.8 .. 0.6.0 - Package Diff
+ return reject(new Error(`Could not resolve ${url}.`)) ... +* **webpack:** configure webpack ... + this.events.on('chainWebpack', { handler: this.config.
Read more >How to configure Vue CLI 3 to leverage webpack root folder ...
With previous Vue CLI I was able to use aliases to keeps my assets in one folder, and linking to the assets wth...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great! The
configureWebpack
option was added in v0.6 so that is probably why it didn’t work 😃Closing this as it now works in
gridsome@0.7.6
. It still doesn’t work in0.5.0
. Maybe it wasn’t supported then? Also, I just noticed that I included the version of the globally installed gridsome instead of the local one in the initial issue description (my bad).