ReferenceError: webpack is not defined
剛才引入
new webpack.BannerPlugin('版權歸牛XX公司所有')
報錯:
[webpack-cli] ReferenceError: webpack is not defined
at Object.<anonymous> (E:\workplace\vuework\webpack\04-webpack配置vue\webpack.config.js:76:13)
at Module._compile (E:\workplace\vuework\webpack\04-webpack配置vue\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (E:\workplace\vuework\webpack\04-webpack配置vue\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at requireConfig (E:\workplace\vuework\webpack\04-webpack配置vue\node_modules\webpack-cli\lib\groups\resolveConfig.js:73:18)
at Array.map (<anonymous>)
處理方法是在檔案的頭部:
const webpack = require('webpack');
檔案尾部再
相關文章
- jQuery報錯:Uncaught ReferenceError: $ is not definedjQueryError
- 報錯ReferenceError: require is not defined,找不到requireErrorUI
- toMyCar:119 Uncaught ReferenceError: toJS is not defined at HTMLAnchorElement.onclickErrorJSHTML
- 【爬坑日記】vue中引入echarts,報錯ReferenceError: echarts is not definedVueEchartsError
- 報錯:Uncaught ReferenceError: SockJS is not defined at gomoku.js:1:16 crack.js:1 enable_copy_cracked:falseErrorJSGoFalse
- 2024-08-20 ReferenceError: process is not defined (vue3+vite)==》把process.env替換成import.meta即可ErrorVueViteImport
- default gateway is not definedGateway
- define和defined區別
- __dirname is not defined in ES module scope
- 【VS】_WIN32_WINNT not definedWin32
- golang gdb Function "main" not defined.GolangFunctionAI
- NLS_LANG is not defined on the client.client
- what is conversion exit defined in ABAP domainAI
- php中defined與define()函式PHP函式
- User defined table type and table valued parameters
- ELEC5517: Software Defined Networks
- spring getBean(String) No bean named '' is definedSpringBean
- SAP PP What is MRP Area And How Is It defined
- 關於$ is not defined的原因和解決辦法
- Pre-defined C/C++ Compiler MacrosC++CompileMacROS
- webpack(2)webpack核心概念Web
- idea匯入專案報Maven version is not definedIdeaMaven
- 報錯No bean named ' is defined的原因和解決方案Bean
- Azure 使用者自定義路由 (User Defined Route)路由
- BAdI: Customer-defined Functions in Formula BuilderFunctionORMUI
- vue使用vue-amap元件報錯AMap is not definedVue元件
- vue 在methods中定義的函式 not definedVue函式
- UglifyJsPlugin 壓縮js程式碼後出現ReferenceError 變數未定義報錯JSPluginError變數
- webpack 3.1 升級webpack 4.0Web
- webpackWeb
- VS error LNK2005:**already defined in **.objErrorOBJ
- Python 解決 :NameError: name 'reload' is not defined 問題PythonError
- 除錯記錄:The public type must be defined in its own file除錯
- 解決proto3的"Timestamp" is not defined問題
- 必會webpack(一)--- 初識webpackWeb
- webpack系列--淺析webpack的原理Web
- webpack(6)webpack處理圖片Web
- webpack 基礎入門 - 瞭解webpackWeb