webpack配置文件 Posted on 2018-05-19 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051const path = require('path');module.exports = { // 入口文件entry: './src/index.js',// 输出文件output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist')},module: { rules: [ { // css 样式加载 test: /\.css$/, use: [ 'style-loader', 'css-loader' ] }, { // 图片加载 test: /\.(png|svg|jpg|gif)$/, use: [ 'file-loader' ] }, { // 加载字体 test: /\.(woff|woff2|eot|ttf|otf)$/, use: [ 'file-loader' ] }, { // 加载数据 test: /\.(csv|tsv)$/, use: [ 'css-loader' ] }, { // xml文件 test: /\.xml$/, use: [ 'xml-loader' ] } ] }}