mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
* i18n fixes - fix issue with default (fallback) language set to browser language - fix issue with fallback language loading when browser language set to non-English locale * code and UI fixes - move document list i18n strings into own scope - replace MDL menu with @angular/material menu (fixes issue with menu items translation, not supported by MDL) - minor improvements * fix unit tests * improve i18n docs and code - provide basic documentation for Translation service - remove custom Login component localisation in favour of documentation sample - simplified i18n setup for demo shell (single path for dev/prod env) * remove unnecessary comments
102 lines
3.1 KiB
JavaScript
102 lines
3.1 KiB
JavaScript
var webpack = require('webpack');
|
|
var webpackMerge = require('webpack-merge');
|
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
var commonConfig = require('./webpack.common.js');
|
|
var helpers = require('./helpers');
|
|
|
|
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
|
|
|
|
module.exports = webpackMerge(commonConfig, {
|
|
devtool: 'source-map',
|
|
|
|
output: {
|
|
path: helpers.root('dist'),
|
|
publicPath: '/',
|
|
filename: '[name].[hash].js',
|
|
chunkFilename: '[id].[hash].chunk.js'
|
|
},
|
|
|
|
htmlLoader: {
|
|
minimize: false // workaround for ng2
|
|
},
|
|
|
|
plugins: [
|
|
// Define env variables to help with builds
|
|
// Reference: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
|
|
new webpack.DefinePlugin({
|
|
'process.env': {
|
|
'ENV': JSON.stringify(ENV)
|
|
}
|
|
}),
|
|
|
|
// Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin
|
|
// Only emit files when there are no errors
|
|
new webpack.NoErrorsPlugin(),
|
|
|
|
// Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin
|
|
// Dedupe modules in the output
|
|
new webpack.optimize.DedupePlugin(),
|
|
|
|
// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
|
|
// Minify all javascript, switch loaders to minimizing mode
|
|
// new webpack.optimize.UglifyJsPlugin({
|
|
// mangle: {
|
|
// keep_fnames: true
|
|
// },
|
|
// compressor: {
|
|
// screw_ie8: true,
|
|
// warnings: false
|
|
// }
|
|
// }),
|
|
|
|
// Extract css files
|
|
// Reference: https://github.com/webpack/extract-text-webpack-plugin
|
|
// Disabled when in test mode or not in build mode
|
|
new ExtractTextPlugin('[name].[hash].css'),
|
|
|
|
// Copy assets from the public folder
|
|
// Reference: https://github.com/kevlened/copy-webpack-plugin
|
|
new CopyWebpackPlugin([
|
|
{
|
|
from: 'favicon-96x96.png'
|
|
},
|
|
{
|
|
from: 'node_modules/pdfjs-dist/build/pdf.worker.js',
|
|
to: 'pdf.worker.js'
|
|
},
|
|
{
|
|
context: 'resources/i18n',
|
|
from: '**/*.json',
|
|
to: 'resources/i18n'
|
|
},
|
|
// Copy i18n folders for all modules with ng2-alfresco- prefix
|
|
{
|
|
context: 'node_modules',
|
|
from: 'ng2-alfresco-*/src/i18n/*.json',
|
|
to: 'node_modules'
|
|
},
|
|
// Copy i18n folders for all modules with ng2-activiti- prefix
|
|
{
|
|
context: 'node_modules',
|
|
from: 'ng2-activiti-*/src/i18n/*.json',
|
|
to: 'node_modules'
|
|
},
|
|
// Copy asstes folders for all modules with ng2-activiti- prefix
|
|
{
|
|
context: 'node_modules',
|
|
from: 'ng2-activiti-*/src/assets/images/*.*',
|
|
to: 'assets/images',
|
|
flatten : true
|
|
},
|
|
// Copy asstes folders for all modules with ng2-alfresco- prefix
|
|
{
|
|
context: 'node_modules',
|
|
from: 'ng2-alfresco-*/src/assets/images/*.*',
|
|
to: 'assets/images',
|
|
flatten : true
|
|
}
|
|
])
|
|
]
|
|
});
|