build (migration): proper build for packaging
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 9 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
|
@ -5,7 +5,7 @@
|
|||
<title>Nuage</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="manifest" href="/assets/manifest.json">
|
||||
<meta content="yes" name="apple-mobile-web-app-capable">
|
||||
<meta content="Nuage" name="apple-mobile-web-app-title">
|
||||
<meta content="black-translucent" name="apple-mobile-web-app-status-bar-style">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import Router from './router';
|
|||
import './assets/css/reset.scss';
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/cache.js').catch(function(error) {
|
||||
navigator.serviceWorker.register('/assets/worker/cache.js').catch(function(error) {
|
||||
console.log('ServiceWorker registration failed:', error);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@
|
|||
"browserify": "^16.1.1",
|
||||
"chai": "^4.1.2",
|
||||
"codemirror": "^5.26.0",
|
||||
"compression-webpack-plugin": "^1.1.11",
|
||||
"copy-webpack-plugin": "^4.5.2",
|
||||
"css-loader": "^0.28.10",
|
||||
"dropbox": "^2.5.3",
|
||||
"ejs": "^2.5.6",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ const path = require('path');
|
|||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const CompressionPlugin = require('compression-webpack-plugin');
|
||||
|
||||
|
||||
|
||||
let config = {
|
||||
entry: {
|
||||
|
|
@ -10,10 +14,10 @@ let config = {
|
|||
app: path.join(__dirname, 'client', 'index.js')
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, 'server', 'public'),
|
||||
path: path.join(__dirname, 'dist', 'data', 'public'),
|
||||
publicPath: '/',
|
||||
filename: 'js/[name].js',
|
||||
chunkFilename: "js/chunk.[name].[id].js"
|
||||
filename: 'assets/js/[name].js',
|
||||
chunkFilename: "assets/js/chunk.[name].[id].js"
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
|
@ -49,16 +53,29 @@ let config = {
|
|||
template: path.join(__dirname, 'client', 'index.html'),
|
||||
inject:true
|
||||
}),
|
||||
new CopyWebpackPlugin([
|
||||
{ from: 'client/manifest.json', to: 'assets/', context: "" },
|
||||
{ from: 'client/worker/*.js', to: 'assets/worker/', context: "" },
|
||||
{ from: 'client/assets/logo/*', to: 'assets/logo', context: "" }
|
||||
])
|
||||
//new BundleAnalyzerPlugin()
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
|
||||
if(process.env.NODE_ENV === 'production'){
|
||||
config.plugins.push(new UglifyJSPlugin({
|
||||
sourceMap: false
|
||||
}));
|
||||
config.plugins.push(new CompressionPlugin({
|
||||
asset: "[path].gz[query]",
|
||||
algorithm: "gzip",
|
||||
test: /\.js$|\.json$|\.html$/,
|
||||
threshold: 0,
|
||||
minRatio: 0.8
|
||||
}));
|
||||
)
|
||||
|
||||
}else{
|
||||
config.devtool = '#inline-source-map';
|
||||
}
|
||||
|
|
|
|||