个人博客
-
从零开始搭建Vue工程
项目骨架 object --dist --src ----assets ------images ------styles ----index.js ----app.vue --webpack.config.js dist目录存放编译后的资源 src存放源码文件 运行命令 `np... -
Automatic publicPath is not supported in this browser
webpack打包资源出现 `Automatic publicPath is not supported in this browser ` 解决方法: 在webpack.config.js文件中添加 ` module.exports = { output: { publicPath: './' } } ` -
configuration.devtool should match pattern "^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)
之前 config.devtool = ' cheap-module-eval-source-map' 现在改成 config.devtool = isDev ? false : ' cheap-module-eval-source-map' -
Cannot find module 'webpack-cli/bin/config-yargs'
webpack编译遇到问题 Cannot find module 'webpack-cli/bin/config-yargs' 原因 webpack-cli与webpack-dev-server版本不兼容 解决办法 1.降级webpack-cli 卸载当前的 webpack-cli npm uninstall webpack-cli... -
webpack 打包 Support for the experimental syntax 'classProperties' isn't currently enabled
解决方案:安装如下插件 npm i -D @babel/plugin-proposal-class-properties 在babelrc中配置插件: ` { "presets": ["@babel/env"], "plugins": ["@babel/plugin-transform-runtime","@babel/plugin-pr... -
启动项目报错this.setDynamic is not a function
此处项目中babel-loader版本为8. ,@babel/core为7.12.9(babel从7.0后更名为@babel) babel7之后的插件一般都是以@babel/开头的。 例子 babel7以前npm安装core npm i babel-core --save-dev babel7以后... -
Babel之babel-polyfill、babel-runtime、transform-runtime详解
引言 babel默认只转换新的 JavaScript 语法,比如箭头函数、扩展运算(spread)。 不转换新的 API,例如Iterator、Generator、Set、Maps、Proxy、Reflect、Symbol、Promise 等全局对象,以及一些定义在全局对象上的... -
Cannot read property 'bindings' of null
webpack打包出错 `Cannot read property 'bindings' of null`  解决办法 npm install -D babel-loade... -
esLint基本使用
1. `npm i eslint eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node eslint-plugin-html ` 2.新键配置文件`.eslintrc` { "extends": "standa... -
Module build failed (from ./node_modules/babel-loader/lib/index.js)
 解决 npm install -D babel-loader @babel/core @babel/preset-env { "presets":[...