- add dashboard and angular routing files
- npm updates - changes in webpack.common.js
This commit is contained in:
parent
72cc5241af
commit
220944b115
17 changed files with 377 additions and 105 deletions
|
@ -8,12 +8,12 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|||
/**
|
||||
* flag Used to check if the environment is production or not
|
||||
*/
|
||||
const isProduction = (process.env.NODE_ENV === 'production');
|
||||
const isProduction = (process.env.NODE_ENV === 'production');
|
||||
// const devMode = (process.env.NODE_ENV !== 'production');
|
||||
|
||||
/**
|
||||
* Include hash to filenames for cache busting - only at production
|
||||
*/
|
||||
/**
|
||||
* Include hash to filenames for cache busting - only at production
|
||||
*/
|
||||
const fileNamePrefix = isProduction ? '[chunkhash].' : '';
|
||||
|
||||
module.exports = {
|
||||
|
@ -35,28 +35,28 @@ module.exports = {
|
|||
},
|
||||
|
||||
// resolve: {
|
||||
// alias: {
|
||||
// "./images/layers.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/layers.png"
|
||||
// ),
|
||||
// "./images/layers-2x.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/layers-2x.png"
|
||||
// ),
|
||||
// "./images/marker-icon.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/marker-icon.png"
|
||||
// ),
|
||||
// "./images/marker-icon-2x.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/marker-icon-2x.png"
|
||||
// ),
|
||||
// "./images/marker-shadow.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/marker-shadow.png"
|
||||
// )
|
||||
// }
|
||||
// alias: {
|
||||
// "./images/layers.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/layers.png"
|
||||
// ),
|
||||
// "./images/layers-2x.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/layers-2x.png"
|
||||
// ),
|
||||
// "./images/marker-icon.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/marker-icon.png"
|
||||
// ),
|
||||
// "./images/marker-icon-2x.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/marker-icon-2x.png"
|
||||
// ),
|
||||
// "./images/marker-shadow.png$": path.resolve(
|
||||
// __dirname,
|
||||
// "./node_modules/leaflet/dist/images/marker-shadow.png"
|
||||
// )
|
||||
// }
|
||||
// },
|
||||
module: {
|
||||
rules: [
|
||||
|
@ -65,26 +65,26 @@ module.exports = {
|
|||
use: [{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name:'[name].[ext]',
|
||||
outputPath:'./assets/'
|
||||
name: '[name].[ext]',
|
||||
outputPath: './assets/'
|
||||
}
|
||||
}]
|
||||
},
|
||||
|
||||
{
|
||||
// test: /\.js$/,
|
||||
test: /\.(js|jsx|tsx|ts)$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
use:
|
||||
[
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
// options: { configFileName: helpers.root('src', 'tsconfig.json') }
|
||||
},
|
||||
{
|
||||
loader: 'angular2-template-loader'
|
||||
}
|
||||
]
|
||||
|
||||
{
|
||||
// test: /\.js$/,
|
||||
test: /\.(js|jsx|tsx|ts)$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
use:
|
||||
[
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
// options: { configFileName: helpers.root('src', 'tsconfig.json') }
|
||||
},
|
||||
{
|
||||
loader: 'angular2-template-loader'
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
// {
|
||||
|
@ -111,14 +111,14 @@ module.exports = {
|
|||
{
|
||||
test: /\.html$/,
|
||||
// exclude: [/node_modules/],
|
||||
include: path.resolve(__dirname, 'src/app'),
|
||||
include: path.resolve(__dirname, 'src/app'),
|
||||
use: {
|
||||
loader: 'raw-loader',
|
||||
options: {
|
||||
esModule: false,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(css|scss)$/,
|
||||
// include: helpers.root('src', 'app'),
|
||||
|
@ -129,78 +129,78 @@ module.exports = {
|
|||
esModule: false,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
// use: ['style-loader', 'css-loader']
|
||||
},
|
||||
{
|
||||
test: /\.(scss|css)$/,
|
||||
test: /\.(scss|css)$/,
|
||||
// exclude: helpers.root('src', 'app'),
|
||||
exclude: path.resolve(__dirname, 'src/app'),
|
||||
use: [
|
||||
{
|
||||
loader: (isProduction === true) ? MiniCssExtractPlugin.loader : 'style-loader',
|
||||
// loader: 'style-loader',
|
||||
// loader: MiniCssExtractPlugin.loader,
|
||||
// options: {
|
||||
// hmr: process.env.NODE_ENV === 'development',
|
||||
// },
|
||||
},
|
||||
// Translates CSS into CommonJS
|
||||
{
|
||||
loader: "css-loader",
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
use: [
|
||||
{
|
||||
loader: (isProduction === true) ? MiniCssExtractPlugin.loader : 'style-loader',
|
||||
// loader: 'style-loader',
|
||||
// loader: MiniCssExtractPlugin.loader,
|
||||
// options: {
|
||||
// hmr: process.env.NODE_ENV === 'development',
|
||||
// },
|
||||
},
|
||||
// Translates CSS into CommonJS
|
||||
{
|
||||
loader: "css-loader",
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['*', '.js', '.jsx', '.tsx', '.ts'],
|
||||
},
|
||||
extensions: ['*', '.js', '.jsx', '.tsx', '.ts'],
|
||||
},
|
||||
// devtool: 'inline-source-map',
|
||||
stats: {
|
||||
colors: true
|
||||
},
|
||||
|
||||
optimization: {
|
||||
minimize: isProduction,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
// cache: true,
|
||||
parallel: true,
|
||||
// sourceMap: true, // Must be set to true if using source-maps in production
|
||||
extractComments: true,
|
||||
terserOptions: {
|
||||
minimize: isProduction,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
// cache: true,
|
||||
parallel: true,
|
||||
// sourceMap: true, // Must be set to true if using source-maps in production
|
||||
extractComments: true,
|
||||
terserOptions: {
|
||||
|
||||
compress: {
|
||||
directives: false,
|
||||
// drop_console: true,
|
||||
// drop_debugger: true,
|
||||
// keep_classnames: false,
|
||||
// keep_fnames: false,
|
||||
},
|
||||
mangle: true, // Note `mangle.properties` is `false` by default.
|
||||
keep_classnames: false,
|
||||
keep_fnames: false,
|
||||
}
|
||||
})
|
||||
],
|
||||
},
|
||||
compress: {
|
||||
directives: false,
|
||||
// drop_console: true,
|
||||
// drop_debugger: true,
|
||||
// keep_classnames: false,
|
||||
// keep_fnames: false,
|
||||
},
|
||||
mangle: true, // Note `mangle.properties` is `false` by default.
|
||||
keep_classnames: false,
|
||||
keep_fnames: false,
|
||||
}
|
||||
})
|
||||
],
|
||||
},
|
||||
|
||||
plugins: [
|
||||
// new MiniCssExtractPlugin({ // Make sure MiniCssExtractPlugin instance is included in array before the PurifyCSSPlugin
|
||||
// // Options similar to the same options in webpackOptions.output
|
||||
// // both options are optional
|
||||
// // filename: '[name].css',
|
||||
// // chunkFilename: '[id].css',
|
||||
// filename: '[name].css',
|
||||
// chunkFilename: '[chunkhash].css',
|
||||
// }),
|
||||
// // Options similar to the same options in webpackOptions.output
|
||||
// // both options are optional
|
||||
// // filename: '[name].css',
|
||||
// // chunkFilename: '[id].css',
|
||||
// filename: '[name].css',
|
||||
// chunkFilename: '[chunkhash].css',
|
||||
// }),
|
||||
]
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue