use: 'raw-loader' } ] } }; test 指定匹配规则 use 指定使⽤用的 loader 名称 核⼼心概念之 Plugins 插件⽤用于 bundle ⽂文件的优化,资源管理理和环境变量量注⼊入 作⽤用于整个构建过程 常⻅见的 Plugins 有哪些? Plugins 的⽤用法 const path = require('path'); module.exports ⽤用来指定当前的构建环境是:production、development 还是 none 设置 mode 可以使⽤用 webpack 内置的函数,默认值为 production Mode 的内置函数功能 资源解析:解析 ES6 const path = require('path'); module.exports = { entry: './src/index.js', output: { filename: babel的配置⽂文件是:.babelrc 资源解析:增加ES6的babel preset配置 { "presets": [ + "@babel/preset-env” ], "plugins": [ "@babel/proposal-class-properties" ] } 增加 ES6 的 babel preset 配置 资源解析:解析 React JSX { "presets":
0 码力 |
41 页 |
2.52 MB
| 1 年前 3