在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ webpack web-webpack-plugin插件的template屬性配

webpack web-webpack-plugin插件的template屬性配置成函數(shù)之后無法打包

最近在研究webpack多頁面,用到一個web-webpack-plugin插件,在測試多頁輸出時(shí),配置template這個屬性后編譯無法通過,代碼如下
webpack.config.js

const { WebPlugin,AutoWebPlugin } = require('web-webpack-plugin')
const path = require('path')
module.exports = {
  entry: {
    app: './src/main.js'
  },
  output: {
    path: path.resolve(__dirname, 'dist/'),
    filename: '[name][hash].js'
  },
  plugins:[
    new AutoWebPlugin('./src/page/', {
      template: (pageName) => {  //配置此處后,webpack編譯就報(bào)錯了,
       return path.resolve('./src/page/',pageName,'index.html');
      },
            ignorePages: ['ignore'],
            commonsChunk: {
                name: 'common',// name prop is require
                minChunks: 2,
            },
            outputPagemap: true,
        }),
  ]
}

看官方手冊配置完template屬性后,發(fā)現(xiàn)打包報(bào)錯 內(nèi)容如下:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.module has an unknown property 'strictThisContextOnImports'. These properties are valid:
   object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, loaders?, noParse?, rules?, unknownContextCritical?, unknownCon
textRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, strictExpo
rtPresence? }

   Options affecting the normal modules (`NormalModuleFactory`).

幾經(jīng)嘗試后無果,求大佬指點(diǎn)

回答
編輯回答
挽歌

同是新手,沒有用過你說的那個插件。但是多頁面的話,直接指定多個entry,用html-webpack-plugin提取多個html文件都是可以的

2017年12月20日 08:04