1 Star 0 Fork 0

conderpath/myReact

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
conderpath 提交于 2019-06-19 17:28 . init react
const path = require("path")
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './src/app.jsx',
output: {
// publicPath:"/dist/",
path: path.resolve(__dirname, "dist"),
filename: 'js/App.js'
},
mode:"development",
module: {
rules: [
{
test: /\.jsx$/,
exclude: /node_modules/,
use: 'babel-loader'
/*use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env',"react"]
}
}*/
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}, {
test: /\.(png|jpg|gif)$/i,
use: [{
loader: 'url-loader',
options: {
limit: 8192
}
}]
}, {
test: /\.(eot|svg|ttf|woff|woff2|otf)$/i,
use: [{
loader: 'url-loader',
options: {
limit: 8192
}
}]
}
]
},
resolve: {
alias:{
src:path.resolve(__dirname,'src')
},
extensions: ['.js', '.jsx', '.json']
},
plugins: [
new HtmlWebpackPlugin({
template: "index.html"
}),
new CopyPlugin([
{ from: './src/mock', to: './mock' },
])
],
devServer: {
contentBase: path.join(__dirname, 'dist'),
proxy: {
'/api':{
target:"https://c.y.qq.com/musichall",
changeOrigin: true,
pathRewrite: {'^/api' : ''}
}
},
// compress: true,
port: 9000/*,
historyApiFallback: {
index: '/dist/'
}*/
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/conderpath/myReact.git
git@gitee.com:conderpath/myReact.git
conderpath
myReact
myReact
master

搜索帮助