|
|
@@ -17,7 +17,10 @@ const PORT = process.env.PORT && Number(process.env.PORT)
|
|
|
|
|
|
const devWebpackConfig = merge(baseWebpackConfig, {
|
|
|
module: {
|
|
|
- rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
|
|
+ rules: utils.styleLoaders({
|
|
|
+ sourceMap: config.dev.cssSourceMap,
|
|
|
+ usePostCSS: true
|
|
|
+ })
|
|
|
},
|
|
|
// cheap-module-eval-source-map is faster for development
|
|
|
devtool: config.dev.devtool,
|
|
|
@@ -26,9 +29,10 @@ const devWebpackConfig = merge(baseWebpackConfig, {
|
|
|
devServer: {
|
|
|
clientLogLevel: 'warning',
|
|
|
historyApiFallback: {
|
|
|
- rewrites: [
|
|
|
- { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
|
|
- ],
|
|
|
+ rewrites: [{
|
|
|
+ from: /.*/,
|
|
|
+ to: path.posix.join(config.dev.assetsPublicPath, 'index.html')
|
|
|
+ }]
|
|
|
},
|
|
|
hot: true,
|
|
|
contentBase: false, // since we use CopyWebpackPlugin.
|
|
|
@@ -37,18 +41,21 @@ const devWebpackConfig = merge(baseWebpackConfig, {
|
|
|
port: PORT || config.dev.port,
|
|
|
open: config.dev.autoOpenBrowser,
|
|
|
overlay: config.dev.errorOverlay
|
|
|
- ? { warnings: false, errors: true }
|
|
|
+ ? {
|
|
|
+ warnings: false,
|
|
|
+ errors: true
|
|
|
+ }
|
|
|
: false,
|
|
|
publicPath: config.dev.assetsPublicPath,
|
|
|
proxy: config.dev.proxyTable,
|
|
|
quiet: true, // necessary for FriendlyErrorsPlugin
|
|
|
watchOptions: {
|
|
|
- poll: config.dev.poll,
|
|
|
+ poll: config.dev.poll
|
|
|
},
|
|
|
proxy: {
|
|
|
'/api': {
|
|
|
target: 'https://test.4dkankan.com',
|
|
|
- changeOrigin: true,
|
|
|
+ changeOrigin: true
|
|
|
}
|
|
|
},
|
|
|
setup: wepackDevServer
|
|
|
@@ -67,13 +74,11 @@ const devWebpackConfig = merge(baseWebpackConfig, {
|
|
|
inject: true
|
|
|
}),
|
|
|
// copy custom static assets
|
|
|
- new CopyWebpackPlugin([
|
|
|
- {
|
|
|
- from: path.resolve(__dirname, '../static'),
|
|
|
- to: config.dev.assetsSubDirectory,
|
|
|
- ignore: ['.*']
|
|
|
- }
|
|
|
- ])
|
|
|
+ new CopyWebpackPlugin([{
|
|
|
+ from: path.resolve(__dirname, '../static'),
|
|
|
+ to: config.dev.assetsSubDirectory,
|
|
|
+ ignore: ['.*']
|
|
|
+ }])
|
|
|
]
|
|
|
})
|
|
|
|
|
|
@@ -91,11 +96,11 @@ module.exports = new Promise((resolve, reject) => {
|
|
|
// Add FriendlyErrorsPlugin
|
|
|
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
|
|
compilationSuccessInfo: {
|
|
|
- messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
|
|
+ messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`]
|
|
|
},
|
|
|
onErrors: config.dev.notifyOnErrors
|
|
|
- ? utils.createNotifierCallback()
|
|
|
- : undefined
|
|
|
+ ? utils.createNotifierCallback()
|
|
|
+ : undefined
|
|
|
}))
|
|
|
|
|
|
resolve(devWebpackConfig)
|