mirror of
https://github.com/morten-olsen/parcel.git
synced 2026-02-08 01:36:24 +01:00
update
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { Configuration } from 'webpack';
|
||||
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
||||
import SriPlugin from 'webpack-subresource-integrity';
|
||||
import path from 'path';
|
||||
|
||||
const OfflinePlugin = require('offline-plugin');
|
||||
|
||||
const __DEV__ = process.env.NODE_ENV !== 'production';
|
||||
|
||||
const config: Configuration = {
|
||||
@@ -14,6 +17,7 @@ const config: Configuration = {
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
crossOriginLoading: 'anonymous',
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
@@ -21,10 +25,21 @@ const config: Configuration = {
|
||||
'react-dom': '@hot-loader/react-dom',
|
||||
},
|
||||
},
|
||||
optimization: {
|
||||
usedExports: true,
|
||||
},
|
||||
plugins: [
|
||||
new SriPlugin({
|
||||
hashFuncNames: ['sha256', 'sha384'],
|
||||
enabled: !__DEV__,
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
title: 'Parcel',
|
||||
minify: true,
|
||||
template: path.join(__dirname, 'html.html'),
|
||||
}),
|
||||
new OfflinePlugin({
|
||||
events: true,
|
||||
}),
|
||||
],
|
||||
module: {
|
||||
|
||||
Reference in New Issue
Block a user