2018-03-13 13:44:08 -04:00
|
|
|
const path = require('path')
|
2018-03-13 07:19:30 -04:00
|
|
|
const merge = require('webpack-merge')
|
2019-10-16 06:10:54 -04:00
|
|
|
const CopyPlugin = require('copy-webpack-plugin')
|
2018-03-13 07:19:30 -04:00
|
|
|
|
|
|
|
const base = require('./webpack.config')
|
2019-10-16 06:10:54 -04:00
|
|
|
const PackageVersions = require('./app/src/infrastructure/PackageVersions')
|
2018-03-13 07:19:30 -04:00
|
|
|
|
|
|
|
module.exports = merge(base, {
|
2019-08-06 08:20:02 -04:00
|
|
|
mode: 'production',
|
|
|
|
|
2019-10-16 06:10:54 -04:00
|
|
|
// Enable a full source map. Generates a comment linking to the source map
|
|
|
|
devtool: 'source-map',
|
2018-03-13 07:19:30 -04:00
|
|
|
|
2018-03-13 13:44:08 -04:00
|
|
|
output: {
|
|
|
|
// Override output path to minjs dir
|
2019-10-16 06:10:54 -04:00
|
|
|
path: path.join(__dirname, '/public/minjs'),
|
|
|
|
|
|
|
|
// Override filename to include hash for immutable caching
|
|
|
|
filename: '[name]-[chunkhash].js',
|
|
|
|
|
|
|
|
publicPath: '/minjs/'
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
// Copy vendored dependencies to minjs directory as these are directly
|
|
|
|
// loaded in a script tag by instead of being part of the webpack build
|
|
|
|
new CopyPlugin([
|
|
|
|
{
|
|
|
|
from: 'public/js/libs/angular-1.6.4.min.js',
|
|
|
|
to: 'libs/angular-1.6.4.min.js'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: 'public/js/libs/angular-1.6.4.min.js.map',
|
|
|
|
to: 'libs/angular-1.6.4.min.js.map'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: 'public/js/libs/jquery-1.11.1.min.js',
|
|
|
|
to: 'libs/jquery-1.11.1.min.js'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: 'public/js/libs/jquery-1.11.1.min.js.map',
|
|
|
|
to: 'libs/jquery-1.11.1.min.js.map'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: 'public/js/libs/mathjax',
|
|
|
|
to: 'libs/mathjax'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: 'public/js/libs/sigma-master',
|
|
|
|
to: 'libs/sigma-master'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: `public/js/ace-${PackageVersions.version.ace}/`,
|
|
|
|
to: `ace-${PackageVersions.version.ace}/`
|
|
|
|
}
|
|
|
|
])
|
|
|
|
]
|
2018-03-13 07:19:30 -04:00
|
|
|
})
|