Today, I want to copy the pictures of the company’s projects to build / images,
Direct installation
npm install copy-webpack-plugin --save-dev
, using the latest official documentation
new CopyPlugin({
patterns: [
{ from: 'source', to: 'dest' },
{ from: 'other', to: 'public' },
],
}),
However, it is always reported that cannot read property ‘this compilation’ of undefined
The results show that the webpack is “^ 1.13.2” because the company’s projects are older,
So you can reduce the copy webpack plugin version to below 5.0.0, and then use the old writing method
For example, “copy webpack plugin”: “^ 4.6.0”,
Read More:
- Using pop-up window and I18N, error in render: “typeerror: cannot read property” appears_ T ‘of undefined’ solution
- TypeError: Cannot read property thisCompilation of undefined
- Cannot read property ‘properties’ of undefined
- NPX webpack cannot find module’html webpack plugin’a bug causes headache
- Error in mounted hook: “TypeError: Cannot read property ‘init‘ of undefined“
- Error in created hook: “typeerror: cannot read property ‘cm’ of undefined”
- Has HTML webpack plugin been installed, or error: cannot find module ‘HTML webpack plugin’
- TypeError: Cannot read property ‘username‘ of undefined
- Vue error in render: “typeerror: cannot read property ‘name’ of undefined”
- Cannot read property ‘substring’ of undefined in Vue
- Vue: cannot read property ‘substring’ of undefined“
- extract-text-webpack-plugin" loader is used without the corresponding plugin Error (Fixed)
- Error reported by wechat applet: cannot read property ‘forceupdate’ of undefined
- [Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
- Datatable plug-in error: uncaught typeerror: cannot read property ‘style’ of undefined
- Vue error resolution: TypeError: Cannot read property’_t’ of undefined”
- Uncaught type error: cannot read property ‘MSIE’ of undefined
- Vue error resolution: typeerror: cannot read property ‘_ t’ of undefined”
- [_ Note] Vue.js reported an error: Cannot read property’validate’ of undefined”
- Applet component properties error cannot read property ‘name’ of undefined