First attempt at a netlify deploy preview

This commit is contained in:
dannyrb committed 2019-07-16 09:24:24 -04:00
1 parent 91ee615aee
commit 2279e555a3
10 files changed
+212 -127

No files matched your search

+26 -28
View File
@@ -1,18 +1,16 @@
const merge = require('webpack-merge');
const path = require('path');
const merge = require("webpack-merge");
const path = require("path");
const workboxPlugin = require("workbox-webpack-plugin");
const common = require("./webpack.common");
const workboxPlugin = require('workbox-webpack-plugin');
const common = require('./webpack.common');
const SRC_DIR = path.join(__dirname, '../src');
const DIST_DIR = path.join(__dirname, '../dist');
const SRC_DIR = path.join(__dirname, "../src");
const DIST_DIR = path.join(__dirname, "../dist");
module.exports = (env, argv) => {
const commonConfig = common(env, argv);
return merge(commonConfig, {
mode: 'production',
mode: "production",
stats: {
colors: false,
hash: true,
@@ -22,15 +20,15 @@ module.exports = (env, argv) => {
chunkModules: true,
modules: true,
children: true,
warnings: true,
warnings: true
},
optimization: {
minimize: true,
sideEffects: true,
sideEffects: true
},
output: {
path: DIST_DIR,
filename: '[name].bundle.[chunkhash].js',
filename: "[name].bundle.[chunkhash].js"
},
module: {
rules: [
@@ -38,32 +36,32 @@ module.exports = (env, argv) => {
test: /\.(gif|jpe?g|png|svg)$/i,
use: [
{
loader: 'url-loader',
loader: "url-loader",
options: {
limit: 8192,
},
},
],
limit: 8192
}
}
]
},
{
test: /\.(ttf|eot|woff|woff2)$/i,
use: [
{
loader: 'url-loader',
loader: "url-loader",
options: {
limit: 50000,
},
},
],
},
],
limit: 50000
}
}
]
}
]
},
plugins: [
new workboxPlugin.GenerateSW({
swDest: 'sw.js',
swDest: "sw.js",
clientsClaim: true,
skipWaiting: true,
}),
],
skipWaiting: true
})
]
});
};