When webpack packages JS, is there any way to specify that the output of the JS file is the same as the original js file?

when webpack packages JS, is there any way to specify that the JS file code is not packaged, that is, what is the original code of the js file after output or something, which is equivalent to just copying the file?

May.25,2022

you can use exclude

{
    module: {
        loaders: [{
            test: /\.js$/,
            loader: 'babel-loader',
            include: [
                path.resolve(__dirname, "app/src"),
                path.resolve(__dirname, "app/test")
            ],
            exclude: /node_modules/
        }]
    }
}

output: {
filename: "[name] .js"
}

Menu