renamed webpack config files
This commit is contained in:
parent
9f4cf669de
commit
0b4d36909b
22
webpack.common.js
Normal file
22
webpack.common.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
const path = require('path')
|
||||||
|
//const CleanWebpackPlugin = require('clean-webpack-plugin')
|
||||||
|
//const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: { app: ['@babel/polyfill', './src/index.js'] },
|
||||||
|
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.jsx?$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
loader: 'babel-loader'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
output: {
|
||||||
|
filename: 'bundle.js',
|
||||||
|
path: path.resolve(__dirname, 'dist')
|
||||||
|
}
|
||||||
|
}
|
@ -1,32 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
entry: { app: ['@babel/polyfill', './src/index.js'] },
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.(js|jsx)$/,
|
|
||||||
exclude: /node_modules/,
|
|
||||||
use: ['babel-loader']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.js$/,
|
|
||||||
exclude: /node_modules/,
|
|
||||||
use: ['babel-loader', 'eslint-loader']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['*', '.js', '.jsx']
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
filename: 'bundle.js'
|
|
||||||
},
|
|
||||||
|
|
||||||
devServer: {
|
|
||||||
contentBase: './dist',
|
|
||||||
port: 8080,
|
|
||||||
open: true,
|
|
||||||
proxy: {
|
|
||||||
'/api': 'http://localhost:1337'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
entry: { app: ['@babel/polyfill', './src/index.js'] },
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.(js|jsx)$/,
|
|
||||||
exclude: /node_modules/,
|
|
||||||
use: ['babel-loader']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.js$/,
|
|
||||||
exclude: /node_modules/,
|
|
||||||
use: ['babel-loader', 'eslint-loader']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['*', '.js', '.jsx']
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
filename: 'bundle.js'
|
|
||||||
},
|
|
||||||
|
|
||||||
devServer: {
|
|
||||||
contentBase: './dist',
|
|
||||||
port: 8080,
|
|
||||||
open: true,
|
|
||||||
proxy: {
|
|
||||||
'/api': 'http://localhost:1337'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
10
webpack.dev.js
Normal file
10
webpack.dev.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const merge = require('webpack-merge')
|
||||||
|
const common = require('./webpack.common.js')
|
||||||
|
|
||||||
|
module.exports = merge(common, {
|
||||||
|
mode: 'development',
|
||||||
|
devtool: 'inline-source-map',
|
||||||
|
devServer: {
|
||||||
|
contentBase: './dist'
|
||||||
|
}
|
||||||
|
})
|
6
webpack.prod.js
Normal file
6
webpack.prod.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
const merge = require('webpack-merge')
|
||||||
|
const common = require('./webpack.common.js')
|
||||||
|
|
||||||
|
module.exports = merge(common, {
|
||||||
|
mode: 'production'
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user