admin管理员组文章数量:1323176
Using vue-cli3 and trying to load a csv file via fetch mand, I have configured vue.config.file like this
module.exports = {
chainWebpack: config => {
config.module
.rule('csv')
.use('file-loader')
}
}
and getting error:
INFO Starting development server...
ERROR Error: No loader specified
Error: No loader specified
at Function.normalizeUseItem (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:274:10)
at Function.normalizeUse (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:236:19)
at use.map (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:233:33)
at Array.map (<anonymous>)
at Function.normalizeUse (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:233:6)
at Function.normalizeRule (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:184:26)
at rules.map (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:86:20)
at Array.map (<anonymous>)
at Function.normalizeRules (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:85:17)
at new RuleSet (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:80:24)
error Command failed with exit code 1.
info Visit for documentation about this mand.
Using vue-cli3 and trying to load a csv file via fetch mand, I have configured vue.config.file like this
module.exports = {
chainWebpack: config => {
config.module
.rule('csv')
.use('file-loader')
}
}
and getting error:
INFO Starting development server...
ERROR Error: No loader specified
Error: No loader specified
at Function.normalizeUseItem (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:274:10)
at Function.normalizeUse (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:236:19)
at use.map (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:233:33)
at Array.map (<anonymous>)
at Function.normalizeUse (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:233:6)
at Function.normalizeRule (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:184:26)
at rules.map (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:86:20)
at Array.map (<anonymous>)
at Function.normalizeRules (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:85:17)
at new RuleSet (D:\Learn\d3\d3-projects\node_modules\webpack\lib\RuleSet.js:80:24)
error Command failed with exit code 1.
info Visit https://yarnpkg./en/docs/cli/run for documentation about this mand.
Share
Improve this question
asked Apr 1, 2018 at 6:01
coure2011coure2011
42.5k87 gold badges225 silver badges361 bronze badges
1 Answer
Reset to default 7According to https://www.npmjs./package/webpack-chain what you've done is created a 'named use' but have not defined an associated loader. It appears that the config module requires invoking the functions in a specific order, which might not be very intuitive:
chainWebpack: config => {
config.module
.rule("html") //create a named rule
.test(/web-ponents/) //define the file test
.use("html-loader") //create a named use
.loader("html-loader") //assign a loader
.end(); //back up to define another use, e.g. you could do .end().use()....
}
本文标签: javascriptError No loader specified configuring vueconfigjsStack Overflow
版权声明:本文标题:javascript - Error: No loader specified configuring vue.config.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742133838a2422281.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论