renamed webpack config files

This commit is contained in:
notnull 2019-03-22 17:59:34 -04:00
parent 9f4cf669de
commit 0b4d36909b
5 changed files with 38 additions and 64 deletions

22
webpack.common.js Normal file
View 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')
}
}

View File

@ -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'
}
}
}

View File

@ -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
View 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
View File

@ -0,0 +1,6 @@
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
module.exports = merge(common, {
mode: 'production'
})