Reputation: 12157
Configuration in my webpack.config.js
file:
new CopyWebpackPlugin([
{
from: 'src/app/**/*.json',
to: path.join(__dirname, 'dist'),
logLevel: 'trace'
}
])
When I do this, I see the json
files added to webpack's output:
src/app/core/error/i18n/en-AU.json 39 bytes [emitted]
src/app/core/error/i18n/en-US.json 38 bytes [emitted]
src/app/core/error/i18n/es-ES.json 36 bytes [emitted]
... but they're not in my dist
folder, and I see no logs from the plugin, despite the log level being set to trace
.
Any ideas on what I'm missing?
Upvotes: 2
Views: 5438
Reputation: 95
@MattGrande I am having a similar issue. My files show as being emitted but they are not actually being copied to dist folder.
Excerpt of compilation log:
Version: webpack 4.15.1 Time: 1824ms Built at: 01/29/2020 3:51:51 PM Asset Size Chunks Chunk Names main.js 116 KiB 0 [emitted] main CSS/main.css 76 bytes [emitted] Images/Uplink_Logo_Horiz.jpg 651 KiB [emitted] [big] CSS/adminlte.css 708 KiB [emitted] [big] index.html 6.7 KiB [emitted]
And my webpack config plugin looks like this:
plugins: [ new CopyWebpackPlugin([ { from: './Images/**', to: path.join(__dirname, 'dist'), logLevel: 'trace' }, { from: './CSS/**', to: path.join(__dirname, 'dist'), logLevel: 'trace' } ]), new HtmlWebpackPlugin({ template: './src/index.html' }) ],
I tried changing the order of CopyWebpackPlugin & HtmlWebpackPlugin to no luck. Did you do any other thing to solve this other than just changing the order.
Versions:
"vue": "^2.6.11", "webpack": "^4.15.0", "webpack-cli": "^3.0.8", "copy-webpack-plugin": "^5.1.1", "html-webpack-plugin": "^3.2.0",
Upvotes: 0
Reputation: 12157
It looks like the order of my plugins was my issue. Changing the order to this fixed my issue:
plugins: [
new CopyWebpackPlugin(/* options */),
new HtmlWebpackPlugin(/* options */),
]
I guess something between the two of them doesn't work properly.
Upvotes: 4