0

webpack 3 から 4 にアップグレード中です。html-webpack-plugin で「コードをここに入力してください」

ERROR in Must have a source file to refactor.
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint html-webpack-plugin for "index.html" = ./index.html
    [./node_modules/html-webpack-plugin/lib/loader.js!./pre-index.html] 1.91 KiB {html-webpack-plugin for "index.html"} [built]
Child html-webpack-plugin for "login.html":
     1 asset
    Entrypoint html-webpack-plugin for "login.html" = ./login.html
    [./node_modules/html-webpack-plugin/lib/loader.js!./pre-login.html] 5.31 KiB {html-webpack-plugin for "login.html"} [built]
? ?wdm?: Failed to compile.

エントリポイントを自分自身に設定しようとしているように見えますか?

webpack構成ファイルは巨大ですが、関連する部分は次のとおりです

new HtmlWebpackPlugin({
    template: './pre-index.html',
    filename: outputIndexHtmlFile,
    hash: false,
    inject: true,
    compile: true,
    favicon: false,
    minify: false,
    cache: true,
    showErrors: true,
    chunks: 'all',
    excludeChunks: ['scripts-login', 'ng1'],
    title: 'Webpack App',
    xhtml: true,
    chunksSortMode: function sort(left, right) {
        const leftIndex = entryPoints.indexOf(left.names[0])
        const rightindex = entryPoints.indexOf(right.names[0])
        if (leftIndex > rightindex) {
            return 1
        } else if (leftIndex < rightindex) {
            return -1
        } else {
            return 0
        }
    }
}),
new HtmlWebpackPlugin({
    template: './pre-login.html',
    filename: outputLoginHtmlFile,
    hash: false,
    inject: true,
    compile: true,
    favicon: false,
    minify: false,
    cache: true,
    showErrors: true,
    chunks: ['inline', 'ng1', 'scripts-login'],
    excludeChunks: [],
    title: 'Webpack App',
    xhtml: true,
    chunksSortMode: function sort(left, right) {
        const leftIndex = entryPointsLogin.indexOf(left.names[0])
        const rightindex = entryPointsLogin.indexOf(right.names[0])
        if (leftIndex > rightindex) {
            return 1
        } else if (leftIndex < rightindex) {
            return -1
        } else {
            return 0
        }
    }
}),

 

module.exports = function(env) {
    return {
        mode:'development',
        resolve: {
            extensions: ['.ts', '.js'],
            modules: ['./node_modules', './node_modules']
        },
        resolveLoader: {
            modules: ['./node_modules', './node_modules']
        },
        entry: {
            main: ['./main.js', './ng2/main.ts'],
            polyfills: ['./ng2/polyfills.ts'],
            scripts: 'script-loader!./concat/concat.js',
            styles: ['./ng2/styles.scss'],
            ng1: './ng2/ng1.config.ts',
            'scripts-login': loginDependencies
        },
        output: {
            path: path.join(process.cwd(), 'dist'),
            filename: '[name].bundle.js',
            chunkFilename: '[id].chunk.js'
        },
4

1 に答える 1