2018-09-02 23:26:15 +03:00
|
|
|
const path = require('path')
|
|
|
|
const merge = require('webpack-merge')
|
2019-04-18 00:52:43 +03:00
|
|
|
const VueSSRClientPlugin = require('vue-server-renderer/client-plugin')
|
|
|
|
const WebpackBar = require('webpackbar')
|
|
|
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
|
2018-09-02 23:26:15 +03:00
|
|
|
|
|
|
|
const baseConfig = require('./webpack.base.conf')
|
|
|
|
|
|
|
|
const isProduction = process.env.NODE_ENV === 'production'
|
|
|
|
|
|
|
|
const webpackConfig = merge(baseConfig, {
|
2019-04-18 00:52:43 +03:00
|
|
|
// Entry should be array cause of webpack-hot-client requirements
|
|
|
|
mode: isProduction ? 'production' : 'development',
|
|
|
|
entry: [path.resolve(__dirname, '../client/entry.client.ts')],
|
|
|
|
devtool: isProduction ? false : 'cheap-module-source-map',
|
|
|
|
optimization: {
|
|
|
|
splitChunks: {
|
|
|
|
name: 'manifest',
|
|
|
|
minChunks: Infinity
|
|
|
|
}
|
2018-09-02 23:26:15 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
2019-04-18 00:52:43 +03:00
|
|
|
new VueSSRClientPlugin(),
|
|
|
|
new WebpackBar({
|
|
|
|
name: 'Client'
|
2018-09-02 23:26:15 +03:00
|
|
|
})
|
2019-04-18 00:52:43 +03:00
|
|
|
// TODO make it work
|
|
|
|
/* ,
|
|
|
|
new ForkTsCheckerWebpackPlugin({
|
|
|
|
vue: true,
|
|
|
|
tslint: true,
|
|
|
|
formatter: 'codeframe',
|
|
|
|
checkSyntacticErrors: false
|
|
|
|
}) */
|
2018-09-02 23:26:15 +03:00
|
|
|
]
|
|
|
|
})
|
|
|
|
|
|
|
|
module.exports = webpackConfig
|