Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

vue怎样修改标题 <%= htmlWebpackPlugin.options.title %>

这么改报错。

// vue.config.js
module.exports = {
    configureWebpack: config => {
        config.devtool ='source-map';
        config
            .plugin('html')
            .tap(args => {
                args[0].title= 'test'
                return args
            })
    }
}
 ERROR  TypeError: config.plugin is not a function
TypeError: config.plugin is not a function
    at configureWebpack (D:wgfMy DocumentsGithubpyprojectsups_projectclientvue.config.js:6:14)
    at D:wgfMy DocumentsGithubpyprojectsups_projectclient
[email protected]:266:21
    at Array.forEach (<anonymous>)
    at Service.resolveWebpackConfig (D:wgfMy DocumentsGithubpyprojectsups_projectclient
[email protected]:263:30)
    at PluginAPI.resolveWebpackConfig (D:wgfMy DocumentsGithubpyprojectsups_projectclient
[email protected]:132:25)
    at serve (D:wgfMy DocumentsGithubpyprojectsups_projectclient
[email protected]:74:31)
    at Service.run (D:wgfMy DocumentsGithubpyprojectsups_projectclient
[email protected]:245:12)
    at Object.<anonymous> (D:wgfMy DocumentsGithubpyprojectsups_projectclient
[email protected]:36:9)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:wgfAppDataRoaming
pm-cache\_logs2020-05-28T06_54_26_317Z-debug.log

Process finished with exit code 1

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

chainWebpack


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...