摘要:Vue webpack打包去除console.log需求在生产环境中, 不显示console.log函数 解决在vue.config.js文件中, 添加webpack配置函数, 设置drop_console会忽略掉所有console.*函数 1 module.exports = { 2 config
阅读全文
随笔分类 - webpack
摘要:Axios是vue项目中使用最多的一个第三方开源免费的HTTP库,最大的特点在于可以同时兼容浏览器端和NodeJS服务端。底层通过判定不同的运行环境来自动提供不同的适配器,在浏览器端通过原生的XHR对象来发送请求,而在NodeJS服务端则通过内置的http模块来发送请求。 1、基础示例 1 // 安
阅读全文
摘要:i18n在vue项目里的使用 1.引入 npm install vue-i18n -S 2.文件结构如下 ├─application 应用目录 │ ├─src 开发目录 │ │ ├─i18n 语言包目录 │ │ │ ├─en_us.json 英文 │ │ │ ├─zh_cn.json 中文 │ │
阅读全文
摘要:一:nginx服务器解决方案,修改 .conf 配置文件 有两种解决方案 1: location / { try_files $uri $uri/ @router; index index.html; } location @router { rewrite ^.*$ /index.html las
阅读全文
摘要:提取第三方库,缓存,减少打包体积 1、 dll动态链接库, 使用DllPlugin DllReferencePlugin,将第三方库提取出来另外打包出来,然后动态引入html。可以提高打包速度和缓存第三方库这种方式打包可以见京东团队的gaea方案https://www.npmjs.com/packa
阅读全文
摘要:webpack第三方包的安装和用法 1.husky的安装和用法用途:不符合eslint的规范,不能推送到git上安装:npm install husky -D用法:"precommit": npm run lint-fix 2.vue-server-renderer的安装和用法用途:服务端渲染必须使
阅读全文
摘要:vue-loader.config.js module.exports = (isDev) =>{ return { preserveWhitepace: true, // 删除vue文件的行尾空格 cssModules: { localIdentName: '[path]-[name]-[hash
阅读全文
摘要:1.处理js语法及校验 @babel/core(核心包) @babel/preset-env转化高级语法) @babel/plugin-proposal-decoreators(转化es7语法) @babel/plugin-proposal-class-properties(处理class的语法)
阅读全文
摘要:ERROR in ./src/main.js Module build failed (from ./node_modules/babel-loader/lib/index.js): TypeError: E:\webs\test\src\main.js: Cannot read property
阅读全文
摘要:Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ReferenceError: document is not defined at insertStyleElement (E:\we
阅读全文
摘要:{ "no-alert": 0, //禁止使用alert confirm prompt "no-array-constructor": 2, //禁止使用数组构造器 "no-bitwise": 0, //禁止使用按位运算符 "no-caller": 1, //禁止使用arguments.caller
阅读全文
摘要:postcss-loader 简单来来说就是 css3 的一些特性 在低版本浏览器也能运行,自动添加加前缀 如图 就是 postcss-loader 的杰作源码 <style lang="stylus" scoped> .home{ width 100% height 200px backgroun
阅读全文
摘要:参考文档:https://www.npmjs.com/package/extract-text-webpack-pluginhttps://www.npmjs.com/package/mini-css-extract-plugin 项目的初始诉求是利用webpack来管理css(合并),并增加has
阅读全文

浙公网安备 33010602011771号