1 Star 0 Fork 8

JRK_dai/pile.js

forked from DiDi-opensource/pile.js 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.dev.js 2.76 KB
一键复制 编辑 原始数据 按行查看 历史
renmaomin 提交于 2018-04-10 18:38 . chore: init project
const webpack = require('webpack');
const path = require('path');
// const ExtractTextPlugin = require('extract-text-webpack-plugin');
// Create multiple instances
// const ExtractCSS = new ExtractTextPlugin('styles.css');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const autoprefixer = require('autoprefixer');
const precss = require('precss');
// 错误输出
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
module.exports = {
devtool: 'cheap-module-source-map', // 生成map文件
context: path.resolve(__dirname, 'example'),
entry: {
main: './index',
},
output: {
filename: 'dist/[name].js',
chunkFilename: 'dist/[id].[name].js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
},
module: {
rules: [
// {
// test: /\.(js|jsx)$/,
// loader: 'eslint-loader',
// include: [
// path.resolve(__dirname, 'src/components/badge'),
// ],
// enforce: 'pre',
// options: {
// formatter: require('eslint-friendly-formatter')
// }
// },
{
test: /\.(js|jsx)$/,
include: [
path.resolve(__dirname, 'example'),
path.resolve(__dirname, 'src'),
],
exclude: /node_modules/,
use: [{
loader: 'babel-loader',
}],
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
'postcss-loader',
'less-loader',
],
},
{
test: /\.less$/,
use: [
'style-loader',
'css-loader',
'postcss-loader',
'less-loader',
],
},
{
test: /\.(eot|svg|ttf|woff|woff2)\w*/,
use: [{
loader: 'file-loader',
}],
},
{
test: /\.(png|jpg|gif)$/,
use: [{
loader: 'url-loader?limit=1000',
}],
},
{
test: [/\.jsx$/, /\.es6$/],
exclude: /(node_modules|bower_components)/,
use: [
{ loader: 'babel-loader' },
],
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.es6'],
modules: [path.resolve(__dirname, 'example'), 'node_modules'],
},
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
postcss() {
return [precss, autoprefixer];
},
},
}),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './index.html',
filename: 'index.html',
}),
new FriendlyErrorsPlugin(),
],
devServer: {
port: 3004,
host: '0.0.0.0',
historyApiFallback: true,
noInfo: false,
https: false,
disableHostCheck: true,
proxy: {
changeOrigin: true,
},
// stats: 'minimal'
},
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/dfx/pile.js.git
git@gitee.com:dfx/pile.js.git
dfx
pile.js
pile.js
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385