@papillonarts/setup 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel/index.js +1 -1
- package/eslint/index.js +25 -10
- package/jest/config.js +5 -3
- package/package.json +2 -2
- package/storybook/index.ts +3 -0
- package/storybook/mainSetup.ts +278 -0
- package/storybook/managerSetup.ts +9 -0
- package/storybook/previewSetup.tsx +50 -0
- package/webpack/constant/index.ts +24 -0
- package/webpack/index.ts +27 -0
- package/webpack/loader/babelLoader.ts +38 -0
- package/webpack/loader/cssLoader.ts +13 -0
- package/webpack/loader/fontLoader.ts +8 -0
- package/webpack/loader/imageLoader.ts +8 -0
- package/webpack/loader/markdownLoader.ts +17 -0
- package/webpack/loader/postCSSLoader.ts +14 -0
- package/webpack/loader/{sassLoader.js → sassLoader.ts} +7 -14
- package/webpack/loader/svgrLoader.ts +17 -0
- package/webpack/plugin/bannerPlugin.ts +18 -0
- package/webpack/plugin/cleanWebpackPlugin.ts +27 -0
- package/webpack/plugin/copyWebpackPlugin.ts +18 -0
- package/webpack/plugin/cssMinimizerWebpackPlugin.ts +7 -0
- package/webpack/plugin/dotenvWebpack.ts +19 -0
- package/webpack/plugin/hotModuleReplacementPlugin.ts +7 -0
- package/webpack/plugin/htmlWebpackPlugin.ts +25 -0
- package/webpack/plugin/miniCSSExtractPlugin.ts +16 -0
- package/webpack/plugin/moduleConcatenationPlugin.ts +7 -0
- package/webpack/plugin/webpackBundleAnalyzer.ts +7 -0
- package/webpack/plugin/webpackManifestPlugin.ts +15 -0
- package/webpack/server/devServer.ts +13 -0
- package/webpack/setup/commonSetup.ts +36 -0
- package/webpack/setup/developmentSetup.ts +52 -0
- package/webpack/setup/productionSetup.ts +66 -0
- package/storybook/index.js +0 -26
- package/storybook/mainSetup.js +0 -265
- package/storybook/managerSetup.js +0 -16
- package/storybook/previewSetup.js +0 -54
- package/webpack/constant/index.js +0 -15
- package/webpack/index.js +0 -202
- package/webpack/loader/babelLoader.js +0 -31
- package/webpack/loader/cssLoader.js +0 -22
- package/webpack/loader/fontLoader.js +0 -14
- package/webpack/loader/imageLoader.js +0 -14
- package/webpack/loader/markdownLoader.js +0 -20
- package/webpack/loader/postCSSLoader.js +0 -22
- package/webpack/loader/svgrLoader.js +0 -25
- package/webpack/plugin/bannerPlugin.js +0 -16
- package/webpack/plugin/cleanWebpackPlugin.js +0 -31
- package/webpack/plugin/copyWebpackPlugin.js +0 -24
- package/webpack/plugin/cssMinimizerWebpackPlugin.js +0 -13
- package/webpack/plugin/dotenvWebpack.js +0 -35
- package/webpack/plugin/hotModuleReplacementPlugin.js +0 -13
- package/webpack/plugin/htmlWebpackPlugin.js +0 -42
- package/webpack/plugin/miniCSSExtractPlugin.js +0 -22
- package/webpack/plugin/moduleConcatenationPlugin.js +0 -13
- package/webpack/plugin/webpackBundleAnalyzer.js +0 -15
- package/webpack/plugin/webpackManifestPlugin.js +0 -21
- package/webpack/server/devServer.js +0 -21
- package/webpack/setup/commonSetup.js +0 -37
- package/webpack/setup/developmentSetup.js +0 -54
- package/webpack/setup/productionSetup.js +0 -59
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getPostCSSLoaderStandardSetup = getPostCSSLoaderStandardSetup;
|
|
7
|
-
// https://github.com/webpack-contrib/postcss-loader
|
|
8
|
-
|
|
9
|
-
function getPostCSSLoaderStandardSetup() {
|
|
10
|
-
return {
|
|
11
|
-
loader: 'postcss-loader',
|
|
12
|
-
options: {
|
|
13
|
-
postcssOptions: {
|
|
14
|
-
sourceMap: true,
|
|
15
|
-
plugins: function plugins() {
|
|
16
|
-
return ['postcss-preset-env'];
|
|
17
|
-
},
|
|
18
|
-
parser: 'postcss-scss'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getSVGRLoaderAdvancedSetup = getSVGRLoaderAdvancedSetup;
|
|
7
|
-
exports.getSVGRLoaderStandardSetup = getSVGRLoaderStandardSetup;
|
|
8
|
-
// https://github.com/gregberge/svgr/tree/main/packages/webpack
|
|
9
|
-
|
|
10
|
-
function getSVGRLoaderStandardSetup() {
|
|
11
|
-
return {
|
|
12
|
-
test: /\.svg$/,
|
|
13
|
-
use: ['@svgr/webpack']
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function getSVGRLoaderAdvancedSetup() {
|
|
17
|
-
return {
|
|
18
|
-
test: /\.svg$/i,
|
|
19
|
-
issuer: /\.[jt]sx?$/,
|
|
20
|
-
resourceQuery: {
|
|
21
|
-
not: [/url/]
|
|
22
|
-
},
|
|
23
|
-
use: ['@svgr/webpack']
|
|
24
|
-
};
|
|
25
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getBannerPluginStandardSetup = getBannerPluginStandardSetup;
|
|
8
|
-
var _webpack = _interopRequireDefault(require("webpack"));
|
|
9
|
-
// https://webpack.js.org/plugins/banner-plugin/
|
|
10
|
-
|
|
11
|
-
function getBannerPluginStandardSetup(packageJSON) {
|
|
12
|
-
return new _webpack["default"].BannerPlugin({
|
|
13
|
-
banner: ['/*!', " * @project ".concat(packageJSON.name), ' * @name [filebase]', " * @author ".concat(packageJSON.author.name), " * @copyright Copyright (c) ".concat(new Date().getFullYear(), " ").concat(packageJSON.author.name), ' */', ''].join('\n'),
|
|
14
|
-
raw: true
|
|
15
|
-
});
|
|
16
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getCleanWebpackPluginAdvancedSetup = getCleanWebpackPluginAdvancedSetup;
|
|
7
|
-
exports.getCleanWebpackPluginStandardSetup = getCleanWebpackPluginStandardSetup;
|
|
8
|
-
var _cleanWebpackPlugin = require("clean-webpack-plugin");
|
|
9
|
-
// https://github.com/johnagan/clean-webpack-plugin
|
|
10
|
-
|
|
11
|
-
function getCleanWebpackPluginStandardSetup() {
|
|
12
|
-
return new _cleanWebpackPlugin.CleanWebpackPlugin();
|
|
13
|
-
}
|
|
14
|
-
function getCleanWebpackPluginAdvancedSetup(_ref) {
|
|
15
|
-
var dry = _ref.dry,
|
|
16
|
-
verbose = _ref.verbose,
|
|
17
|
-
cleanStaleWebpackAssets = _ref.cleanStaleWebpackAssets,
|
|
18
|
-
protectWebpackAssets = _ref.protectWebpackAssets,
|
|
19
|
-
cleanOnceBeforeBuildPatterns = _ref.cleanOnceBeforeBuildPatterns,
|
|
20
|
-
cleanAfterEveryBuildPatterns = _ref.cleanAfterEveryBuildPatterns,
|
|
21
|
-
dangerouslyAllowCleanPatternsOutsideProject = _ref.dangerouslyAllowCleanPatternsOutsideProject;
|
|
22
|
-
return new _cleanWebpackPlugin.CleanWebpackPlugin({
|
|
23
|
-
dry: dry,
|
|
24
|
-
verbose: verbose,
|
|
25
|
-
cleanStaleWebpackAssets: cleanStaleWebpackAssets,
|
|
26
|
-
protectWebpackAssets: protectWebpackAssets,
|
|
27
|
-
cleanOnceBeforeBuildPatterns: cleanOnceBeforeBuildPatterns,
|
|
28
|
-
cleanAfterEveryBuildPatterns: cleanAfterEveryBuildPatterns,
|
|
29
|
-
dangerouslyAllowCleanPatternsOutsideProject: dangerouslyAllowCleanPatternsOutsideProject
|
|
30
|
-
});
|
|
31
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getCopyWebpackPluginStandardSetup = getCopyWebpackPluginStandardSetup;
|
|
8
|
-
var _copyWebpackPlugin = _interopRequireDefault(require("copy-webpack-plugin"));
|
|
9
|
-
// https://github.com/webpack-contrib/copy-webpack-plugin
|
|
10
|
-
|
|
11
|
-
function getCopyWebpackPluginStandardSetup(_ref) {
|
|
12
|
-
var from = _ref.from,
|
|
13
|
-
to = _ref.to;
|
|
14
|
-
return new _copyWebpackPlugin["default"]({
|
|
15
|
-
patterns: [{
|
|
16
|
-
from: from,
|
|
17
|
-
to: to,
|
|
18
|
-
globOptions: {
|
|
19
|
-
ignore: ['*.DS_Store']
|
|
20
|
-
},
|
|
21
|
-
noErrorOnMissing: true
|
|
22
|
-
}]
|
|
23
|
-
});
|
|
24
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getCSSMinimizerWebpackPluginStandardSetup = getCSSMinimizerWebpackPluginStandardSetup;
|
|
8
|
-
var _cssMinimizerWebpackPlugin = _interopRequireDefault(require("css-minimizer-webpack-plugin"));
|
|
9
|
-
// https://github.com/webpack-contrib/css-minimizer-webpack-plugin
|
|
10
|
-
|
|
11
|
-
function getCSSMinimizerWebpackPluginStandardSetup() {
|
|
12
|
-
return new _cssMinimizerWebpackPlugin["default"]();
|
|
13
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getDotenvWebpackAdvancedSetup = getDotenvWebpackAdvancedSetup;
|
|
8
|
-
exports.getDotenvWebpackStandardSetup = getDotenvWebpackStandardSetup;
|
|
9
|
-
var _dotenvWebpack = _interopRequireDefault(require("dotenv-webpack"));
|
|
10
|
-
// https://github.com/mrsteele/dotenv-webpack
|
|
11
|
-
|
|
12
|
-
function getDotenvWebpackStandardSetup(_ref) {
|
|
13
|
-
var path = _ref.path;
|
|
14
|
-
return new _dotenvWebpack["default"]({
|
|
15
|
-
path: path
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function getDotenvWebpackAdvancedSetup(_ref2) {
|
|
19
|
-
var path = _ref2.path,
|
|
20
|
-
safe = _ref2.safe,
|
|
21
|
-
allowEmptyValues = _ref2.allowEmptyValues,
|
|
22
|
-
systemvars = _ref2.systemvars,
|
|
23
|
-
silent = _ref2.silent,
|
|
24
|
-
defaults = _ref2.defaults,
|
|
25
|
-
prefix = _ref2.prefix;
|
|
26
|
-
return new _dotenvWebpack["default"]({
|
|
27
|
-
path: path,
|
|
28
|
-
safe: safe,
|
|
29
|
-
allowEmptyValues: allowEmptyValues,
|
|
30
|
-
systemvars: systemvars,
|
|
31
|
-
silent: silent,
|
|
32
|
-
defaults: defaults,
|
|
33
|
-
prefix: prefix
|
|
34
|
-
});
|
|
35
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getHotModuleReplacementPluginStandardSetup = getHotModuleReplacementPluginStandardSetup;
|
|
8
|
-
var _webpack = _interopRequireDefault(require("webpack"));
|
|
9
|
-
// https://webpack.js.org/plugins/hot-module-replacement-plugin/
|
|
10
|
-
|
|
11
|
-
function getHotModuleReplacementPluginStandardSetup() {
|
|
12
|
-
return new _webpack["default"].HotModuleReplacementPlugin();
|
|
13
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getHtmlWebpackPluginAdvancedSetup = getHtmlWebpackPluginAdvancedSetup;
|
|
8
|
-
exports.getHtmlWebpackPluginStandardSetup = getHtmlWebpackPluginStandardSetup;
|
|
9
|
-
var _htmlWebpackPlugin = _interopRequireDefault(require("html-webpack-plugin"));
|
|
10
|
-
var _constant = require("../constant");
|
|
11
|
-
// https://github.com/jantimon/html-webpack-plugin
|
|
12
|
-
|
|
13
|
-
function getHtmlWebpackPluginStandardSetup(_ref) {
|
|
14
|
-
var title = _ref.title,
|
|
15
|
-
micrositeWebpackFolderPath = _ref.micrositeWebpackFolderPath;
|
|
16
|
-
return new _htmlWebpackPlugin["default"]({
|
|
17
|
-
title: title,
|
|
18
|
-
meta: {
|
|
19
|
-
viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no'
|
|
20
|
-
},
|
|
21
|
-
template: "".concat(micrositeWebpackFolderPath, "/").concat(_constant.indexHTMLName),
|
|
22
|
-
filename: _constant.indexHTMLName,
|
|
23
|
-
inject: 'body',
|
|
24
|
-
scriptLoading: 'defer'
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function getHtmlWebpackPluginAdvancedSetup(_ref2) {
|
|
28
|
-
var title = _ref2.title,
|
|
29
|
-
meta = _ref2.meta,
|
|
30
|
-
template = _ref2.template,
|
|
31
|
-
filename = _ref2.filename,
|
|
32
|
-
inject = _ref2.inject,
|
|
33
|
-
scriptLoading = _ref2.scriptLoading;
|
|
34
|
-
return new _htmlWebpackPlugin["default"]({
|
|
35
|
-
title: title,
|
|
36
|
-
meta: meta,
|
|
37
|
-
template: template,
|
|
38
|
-
filename: filename,
|
|
39
|
-
inject: inject,
|
|
40
|
-
scriptLoading: scriptLoading
|
|
41
|
-
});
|
|
42
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.MiniCSSExtractPluginLoader = void 0;
|
|
8
|
-
exports.getMiniCSSExtractPluginAdvancedSetup = getMiniCSSExtractPluginAdvancedSetup;
|
|
9
|
-
exports.getMiniCSSExtractPluginStandardSetup = getMiniCSSExtractPluginStandardSetup;
|
|
10
|
-
var _miniCssExtractPlugin = _interopRequireDefault(require("mini-css-extract-plugin"));
|
|
11
|
-
// https://github.com/webpack-contrib/mini-css-extract-plugin
|
|
12
|
-
|
|
13
|
-
var MiniCSSExtractPluginLoader = exports.MiniCSSExtractPluginLoader = _miniCssExtractPlugin["default"].loader;
|
|
14
|
-
function getMiniCSSExtractPluginStandardSetup() {
|
|
15
|
-
return new _miniCssExtractPlugin["default"]();
|
|
16
|
-
}
|
|
17
|
-
function getMiniCSSExtractPluginAdvancedSetup() {
|
|
18
|
-
return new _miniCssExtractPlugin["default"]({
|
|
19
|
-
filename: 'styles/[name].[contenthash].css',
|
|
20
|
-
chunkFilename: '[id].css'
|
|
21
|
-
});
|
|
22
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getModuleConcatenationPluginStandardSetup = getModuleConcatenationPluginStandardSetup;
|
|
8
|
-
var _webpack = _interopRequireDefault(require("webpack"));
|
|
9
|
-
// https://webpack.js.org/plugins/module-concatenation-plugin/
|
|
10
|
-
|
|
11
|
-
function getModuleConcatenationPluginStandardSetup() {
|
|
12
|
-
return new _webpack["default"].optimize.ModuleConcatenationPlugin();
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getWebpackBundleAnalyzerStandardSetup = getWebpackBundleAnalyzerStandardSetup;
|
|
7
|
-
var _webpackBundleAnalyzer = require("webpack-bundle-analyzer");
|
|
8
|
-
// https://github.com/webpack-contrib/webpack-bundle-analyzer
|
|
9
|
-
|
|
10
|
-
function getWebpackBundleAnalyzerStandardSetup() {
|
|
11
|
-
return new _webpackBundleAnalyzer.BundleAnalyzerPlugin({
|
|
12
|
-
analyzerMode: 'static',
|
|
13
|
-
openAnalyzer: false
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getWebpackManifestPluginStandardSetup = getWebpackManifestPluginStandardSetup;
|
|
7
|
-
var _webpackManifestPlugin = require("webpack-manifest-plugin");
|
|
8
|
-
var _constant = require("../constant");
|
|
9
|
-
// https://github.com/shellscape/webpack-manifest-plugin
|
|
10
|
-
/* eslint-disable no-param-reassign */
|
|
11
|
-
|
|
12
|
-
function getWebpackManifestPluginStandardSetup() {
|
|
13
|
-
return new _webpackManifestPlugin.WebpackManifestPlugin({
|
|
14
|
-
fileName: _constant.manifestFileName,
|
|
15
|
-
basePath: '',
|
|
16
|
-
map: function map(file) {
|
|
17
|
-
file.name = file.name.replace(/(\.[a-f0-9]{32})(\..*)$/, '$2');
|
|
18
|
-
return file;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getDevServerStandardSetup = getDevServerStandardSetup;
|
|
7
|
-
// https://webpack.js.org/configuration/dev-server/
|
|
8
|
-
|
|
9
|
-
function getDevServerStandardSetup() {
|
|
10
|
-
return {
|
|
11
|
-
historyApiFallback: true,
|
|
12
|
-
open: true,
|
|
13
|
-
compress: true,
|
|
14
|
-
hot: true,
|
|
15
|
-
port: 8080,
|
|
16
|
-
host: 'localhost',
|
|
17
|
-
headers: {
|
|
18
|
-
'Access-Control-Allow-Origin': '*'
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getWebpackCommonSetup = getWebpackCommonSetup;
|
|
7
|
-
var _babelLoader = require("../loader/babelLoader");
|
|
8
|
-
var _fontLoader = require("../loader/fontLoader");
|
|
9
|
-
var _imageLoader = require("../loader/imageLoader");
|
|
10
|
-
var _svgrLoader = require("../loader/svgrLoader");
|
|
11
|
-
var _markdownLoader = require("../loader/markdownLoader");
|
|
12
|
-
var _cleanWebpackPlugin = require("../plugin/cleanWebpackPlugin");
|
|
13
|
-
var _copyWebpackPlugin = require("../plugin/copyWebpackPlugin");
|
|
14
|
-
var _htmlWebpackPlugin = require("../plugin/htmlWebpackPlugin");
|
|
15
|
-
var _webpackManifestPlugin = require("../plugin/webpackManifestPlugin");
|
|
16
|
-
var _constant = require("../constant");
|
|
17
|
-
function getWebpackCommonSetup(_ref) {
|
|
18
|
-
var micrositeFolderPaths = _ref.micrositeFolderPaths,
|
|
19
|
-
packageJSON = _ref.packageJSON;
|
|
20
|
-
return {
|
|
21
|
-
entry: ["".concat(micrositeFolderPaths.src, "/index.js")],
|
|
22
|
-
plugins: [(0, _cleanWebpackPlugin.getCleanWebpackPluginStandardSetup)(), (0, _copyWebpackPlugin.getCopyWebpackPluginStandardSetup)({
|
|
23
|
-
from: micrositeFolderPaths["public"],
|
|
24
|
-
to: 'assets'
|
|
25
|
-
}), (0, _htmlWebpackPlugin.getHtmlWebpackPluginStandardSetup)({
|
|
26
|
-
title: packageJSON.description,
|
|
27
|
-
micrositeWebpackFolderPath: micrositeFolderPaths.webpack
|
|
28
|
-
}), (0, _webpackManifestPlugin.getWebpackManifestPluginStandardSetup)()],
|
|
29
|
-
module: {
|
|
30
|
-
rules: [(0, _babelLoader.getBabelLoaderAdvancedSetup)(), (0, _fontLoader.getFontLoaderStandardSetup)(), (0, _imageLoader.getImageLoaderStandardSetup)(), (0, _markdownLoader.getMarkdownLoaderStandardSetup)(), (0, _svgrLoader.getSVGRLoaderAdvancedSetup)()]
|
|
31
|
-
},
|
|
32
|
-
resolve: {
|
|
33
|
-
modules: [micrositeFolderPaths.src, micrositeFolderPaths.nodeModules],
|
|
34
|
-
extensions: _constant.extensions
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getWebpackDevelopmentSetup = getWebpackDevelopmentSetup;
|
|
7
|
-
var _webpackMerge = require("webpack-merge");
|
|
8
|
-
var _cssLoader = require("../loader/cssLoader");
|
|
9
|
-
var _postCSSLoader = require("../loader/postCSSLoader");
|
|
10
|
-
var _sassLoader = require("../loader/sassLoader");
|
|
11
|
-
var _dotenvWebpack = require("../plugin/dotenvWebpack");
|
|
12
|
-
var _hotModuleReplacementPlugin = require("../plugin/hotModuleReplacementPlugin");
|
|
13
|
-
var _devServer = require("../server/devServer");
|
|
14
|
-
function getWebpackDevelopmentSetup(_ref) {
|
|
15
|
-
var webpackCommonSetup = _ref.webpackCommonSetup,
|
|
16
|
-
environmentVariablesFilePath = _ref.environmentVariablesFilePath,
|
|
17
|
-
micrositeUrlPath = _ref.micrositeUrlPath,
|
|
18
|
-
micrositeFolderPaths = _ref.micrositeFolderPaths,
|
|
19
|
-
includedSourceFilePaths = _ref.includedSourceFilePaths;
|
|
20
|
-
return (0, _webpackMerge.merge)([webpackCommonSetup, {
|
|
21
|
-
mode: 'development',
|
|
22
|
-
devtool: 'inline-source-map',
|
|
23
|
-
devServer: (0, _devServer.getDevServerStandardSetup)(),
|
|
24
|
-
output: {
|
|
25
|
-
path: micrositeFolderPaths.build,
|
|
26
|
-
publicPath: micrositeUrlPath,
|
|
27
|
-
filename: '[name].bundle.js'
|
|
28
|
-
},
|
|
29
|
-
optimization: {
|
|
30
|
-
concatenateModules: true
|
|
31
|
-
},
|
|
32
|
-
plugins: [(0, _dotenvWebpack.getDotenvWebpackStandardSetup)({
|
|
33
|
-
path: environmentVariablesFilePath
|
|
34
|
-
}), (0, _hotModuleReplacementPlugin.getHotModuleReplacementPluginStandardSetup)()],
|
|
35
|
-
module: {
|
|
36
|
-
rules: [{
|
|
37
|
-
test: /\.s[ac]ss$/i,
|
|
38
|
-
include: includedSourceFilePaths,
|
|
39
|
-
use: ['style-loader', (0, _cssLoader.getCSSLoaderStandardSetup)({
|
|
40
|
-
sourceMap: false,
|
|
41
|
-
modules: {
|
|
42
|
-
localIdentName: '[name]_[local]_[hash:base64:5]',
|
|
43
|
-
/* https://webpack.js.org/loaders/css-loader/#exportlocalsconvention */
|
|
44
|
-
exportLocalsConvention: 'as-is'
|
|
45
|
-
},
|
|
46
|
-
/* https://stackoverflow.com/questions/78589664/style-loader-does-not-recoginize-default-imports-of-css-modules-in-storybooks */
|
|
47
|
-
esModule: false
|
|
48
|
-
}), (0, _postCSSLoader.getPostCSSLoaderStandardSetup)(), (0, _sassLoader.getSassLoaderStandardSetup)({
|
|
49
|
-
includedSourceFilePaths: includedSourceFilePaths
|
|
50
|
-
})]
|
|
51
|
-
}]
|
|
52
|
-
}
|
|
53
|
-
}]);
|
|
54
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getWebpackProductionSetup = getWebpackProductionSetup;
|
|
7
|
-
var _webpackMerge = require("webpack-merge");
|
|
8
|
-
var _cssLoader = require("../loader/cssLoader");
|
|
9
|
-
var _bannerPlugin = require("../plugin/bannerPlugin");
|
|
10
|
-
var _cssMinimizerWebpackPlugin = require("../plugin/cssMinimizerWebpackPlugin");
|
|
11
|
-
var _dotenvWebpack = require("../plugin/dotenvWebpack");
|
|
12
|
-
var _miniCSSExtractPlugin = require("../plugin/miniCSSExtractPlugin");
|
|
13
|
-
var _webpackBundleAnalyzer = require("../plugin/webpackBundleAnalyzer");
|
|
14
|
-
function getWebpackProductionSetup(_ref) {
|
|
15
|
-
var webpackCommonSetup = _ref.webpackCommonSetup,
|
|
16
|
-
environmentVariablesFilePath = _ref.environmentVariablesFilePath,
|
|
17
|
-
micrositeUrlPath = _ref.micrositeUrlPath,
|
|
18
|
-
micrositeFolderPaths = _ref.micrositeFolderPaths,
|
|
19
|
-
packageJSON = _ref.packageJSON;
|
|
20
|
-
return (0, _webpackMerge.merge)([webpackCommonSetup, {
|
|
21
|
-
mode: 'production',
|
|
22
|
-
devtool: false,
|
|
23
|
-
output: {
|
|
24
|
-
path: micrositeFolderPaths.build,
|
|
25
|
-
publicPath: micrositeUrlPath,
|
|
26
|
-
filename: 'js/[name].[contenthash].bundle.js'
|
|
27
|
-
},
|
|
28
|
-
performance: {
|
|
29
|
-
hints: false,
|
|
30
|
-
maxEntrypointSize: 512000,
|
|
31
|
-
maxAssetSize: 512000
|
|
32
|
-
},
|
|
33
|
-
optimization: {
|
|
34
|
-
minimize: true,
|
|
35
|
-
minimizer: [(0, _cssMinimizerWebpackPlugin.getCSSMinimizerWebpackPluginStandardSetup)(), '...'],
|
|
36
|
-
runtimeChunk: {
|
|
37
|
-
name: 'runtime'
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
plugins: [(0, _bannerPlugin.getBannerPluginStandardSetup)(packageJSON), (0, _dotenvWebpack.getDotenvWebpackStandardSetup)({
|
|
41
|
-
path: environmentVariablesFilePath
|
|
42
|
-
}), (0, _miniCSSExtractPlugin.getMiniCSSExtractPluginAdvancedSetup)(), (0, _webpackBundleAnalyzer.getWebpackBundleAnalyzerStandardSetup)()],
|
|
43
|
-
module: {
|
|
44
|
-
rules: [{
|
|
45
|
-
test: /\.(sass|scss|css)$/,
|
|
46
|
-
use: [_miniCSSExtractPlugin.MiniCSSExtractPluginLoader, (0, _cssLoader.getCSSLoaderStandardSetup)({
|
|
47
|
-
sourceMap: false,
|
|
48
|
-
modules: {
|
|
49
|
-
localIdentName: '[name]_[local]_[hash:base64:5]',
|
|
50
|
-
/* https://webpack.js.org/loaders/css-loader/#exportlocalsconvention */
|
|
51
|
-
exportLocalsConvention: 'as-is'
|
|
52
|
-
},
|
|
53
|
-
/* https://stackoverflow.com/questions/78589664/style-loader-does-not-recoginize-default-imports-of-css-modules-in-storybooks */
|
|
54
|
-
esModule: false
|
|
55
|
-
}), 'postcss-loader', 'sass-loader']
|
|
56
|
-
}]
|
|
57
|
-
}
|
|
58
|
-
}]);
|
|
59
|
-
}
|