Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use webPack watch mode and the terminal always outputs logs between two hashes, although nothing has changed about files #163

Open
imjeen opened this issue Jul 16, 2019 · 1 comment

Comments

@imjeen
Copy link

imjeen commented Jul 16, 2019

Added the add-asset-html-webpack-plugin@3.1.3 plugin for webpack config , and got the problem.

Redo

step 1. webpack --config webpack.dll.babel.js --progress
step 2. webpack --config webpack.build.babel.js --watch --progress

and the terminal logs always changed between two kinds of logs, but the files not be modified.

config

below was basic config:

/** webpack.dll.babel.js */
export default {
    entry: {
        common: [
            '@babel/polyfill',
            'es6-promise',
            'vue',
            // ....
        ]
    },
    output: {
        path: path.resolve(__dirname, '../dist'),
        filename: 'manifest/[name].dll.js?[chunkhash]',
        library: '[name]',
    },
    plugins: [
        new webpack.DllPlugin({
            context: '.',
            name: '[name]',
            path: path.resolve(__dirname, `../dist/manifest/[name].dll.json`),
        }),
    ],
}


/** webpack.build.babel.js */
export default {
    entry: {
        main: path.resolve(__dirname, '../app/main.js'),
    },

    output: {
        path: path.resolve(__dirname, '../dist'),
        filename: `js/[name].js?[hash]`,
        chunkFilename: `js/[name].js?[hash]`
    },

    plugins: [
        new webpack.DllReferencePlugin({
            context: '.',
            manifest: require(path.resolve(
                __dirname,
                `../dist/manifest/common.dll.json`,
            )),
        }),
        new HtmlWebpackPlugin({
            template: path.resolve(__dirname, '../app/index.template.html'),
            filename: 'index.html',
        }),
        new AddAssetHtmlPlugin({
            hash: true,
            publicPath: 'manifest/',
            outputPath: 'manifest/',
            filepath: path.resolve(__dirname, '../dist/manifest/*.dll.js'),
        }),
    ],
};

devDependencies

  • webpack@4.35.3
  • webpack-cli@3.3.6
  • add-asset-html-webpack-plugin@3.1.3
@imjeen
Copy link
Author

imjeen commented Jul 17, 2019

Watching files were not changed, the terminal alway show dynamic log between two hash logs.

As so far,I found a temporary way to make the silence log output that adding the webpack config stats: 'errors-warnings' (wepack Stats).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant