@studyportals/webpack-helper 5.3.0-ST63903.1 → 5.3.1-beta
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/package.json +10 -12
- package/src/defaults/development.config.js +8 -8
- package/src/defaults/production.config.js +62 -62
- package/src/enums/mode.js +8 -8
- package/src/enums/preset.js +10 -10
- package/src/factories/configuration-factory.js +10 -10
- package/src/interfaces/bob.interface.js +2 -2
- package/src/interfaces/entry.interface.js +2 -2
- package/src/interfaces/entrypoint.interface.js +2 -2
- package/src/interfaces/output.interface.js +2 -2
- package/src/interfaces/preset.interface.js +2 -2
- package/src/main.js +5 -5
- package/src/model/configuration.js +125 -125
- package/src/model/entry.js +12 -12
- package/src/model/module.js +17 -17
- package/src/model/output.js +45 -45
- package/src/model/plugins.js +16 -16
- package/src/presets/javascript.preset.js +47 -47
- package/src/presets/typescript.preset.js +74 -74
- package/src/presets/vue-typescript-no-code-splitting.preset.js +20 -20
- package/src/presets/vue-typescript.preset.js +105 -105
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/webpack-helper",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.1-beta",
|
|
4
4
|
"description": "A collection of standard configurations and helpers for webpack.",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,22 +19,20 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@babel/core": "^7.
|
|
23
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
22
|
+
"@babel/core": "^7.23.9",
|
|
23
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
24
24
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
25
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
26
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
27
|
-
"@babel/plugin-transform-typescript": "^7.
|
|
28
|
-
"@babel/preset-env": "^7.
|
|
29
|
-
"@babel/preset-typescript": "^7.
|
|
30
|
-
"@babel/runtime": "^7.
|
|
25
|
+
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
|
|
26
|
+
"@babel/plugin-transform-runtime": "^7.23.9",
|
|
27
|
+
"@babel/plugin-transform-typescript": "^7.23.6",
|
|
28
|
+
"@babel/preset-env": "^7.23.9",
|
|
29
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
30
|
+
"@babel/runtime": "^7.23.9",
|
|
31
31
|
"@studyportals/bob-manifest-generator": "5.0.1",
|
|
32
32
|
"@studyportals/browserslist-config": "^1.2.0",
|
|
33
33
|
"@studyportals/dll-availability-tracker": "^2.0.0",
|
|
34
34
|
"@studyportals/vue-config": "^5.0.2",
|
|
35
35
|
"@types/jest": "^27.0.0",
|
|
36
|
-
"@vue/cli-plugin-babel": "^5.0.4",
|
|
37
|
-
"@vue/cli-plugin-unit-jest": "^5.0.4",
|
|
38
36
|
"@vue/test-utils": "^2.0.2",
|
|
39
37
|
"@vue/vue3-jest": "^27.0.0",
|
|
40
38
|
"babel-jest": "^27.5.1",
|
|
@@ -54,7 +52,7 @@
|
|
|
54
52
|
"ts-jest": "^27.0.0",
|
|
55
53
|
"ts-loader": "^9.2.6",
|
|
56
54
|
"typescript": "^4.7.4",
|
|
57
|
-
"vue-loader": "^16.
|
|
55
|
+
"vue-loader": "^16.8.3",
|
|
58
56
|
"webpack": "^5.76.0",
|
|
59
57
|
"webpack-cli": "^4.9.1",
|
|
60
58
|
"webpack-merge": "^5.8.0"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DevelopmentConfig = void 0;
|
|
4
|
-
exports.DevelopmentConfig = {
|
|
5
|
-
optimization: {
|
|
6
|
-
minimize: false
|
|
7
|
-
}
|
|
8
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DevelopmentConfig = void 0;
|
|
4
|
+
exports.DevelopmentConfig = {
|
|
5
|
+
optimization: {
|
|
6
|
+
minimize: false
|
|
7
|
+
}
|
|
8
|
+
};
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductionConfig = void 0;
|
|
4
|
-
const webpack = require('webpack');
|
|
5
|
-
const cssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
6
|
-
const DllAvailabilityTracker = require('@studyportals/dll-availability-tracker');
|
|
7
|
-
const ProductionConfig = (bobConfig) => {
|
|
8
|
-
let dllDependencies = ['library'];
|
|
9
|
-
if (bobConfig && bobConfig.hasOwnProperty('dllPackages')) {
|
|
10
|
-
bobConfig.dllPackages.forEach((dependency) => dllDependencies.push(dependency.manifest.name));
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
plugins: [
|
|
14
|
-
new webpack.LoaderOptionsPlugin({
|
|
15
|
-
minimize: true
|
|
16
|
-
}),
|
|
17
|
-
new webpack.DefinePlugin({
|
|
18
|
-
'process.env': {
|
|
19
|
-
NODE_ENV: '"production"'
|
|
20
|
-
}
|
|
21
|
-
}),
|
|
22
|
-
new cssMinimizerPlugin({
|
|
23
|
-
minimizerOptions: {
|
|
24
|
-
preset: [
|
|
25
|
-
'default',
|
|
26
|
-
{
|
|
27
|
-
discardComments: {
|
|
28
|
-
removeAll: true
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
}),
|
|
34
|
-
new DllAvailabilityTracker({
|
|
35
|
-
dependencies: dllDependencies || []
|
|
36
|
-
})
|
|
37
|
-
],
|
|
38
|
-
optimization: {
|
|
39
|
-
minimize: true,
|
|
40
|
-
minimizer: [
|
|
41
|
-
compiler => {
|
|
42
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
43
|
-
new TerserPlugin({
|
|
44
|
-
parallel: true,
|
|
45
|
-
extractComments: false,
|
|
46
|
-
terserOptions: {
|
|
47
|
-
output: {
|
|
48
|
-
comments: false
|
|
49
|
-
},
|
|
50
|
-
compress: {
|
|
51
|
-
drop_console: true,
|
|
52
|
-
passes: 5
|
|
53
|
-
},
|
|
54
|
-
sourceMap: true
|
|
55
|
-
}
|
|
56
|
-
}).apply(compiler);
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
exports.ProductionConfig = ProductionConfig;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductionConfig = void 0;
|
|
4
|
+
const webpack = require('webpack');
|
|
5
|
+
const cssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
6
|
+
const DllAvailabilityTracker = require('@studyportals/dll-availability-tracker');
|
|
7
|
+
const ProductionConfig = (bobConfig) => {
|
|
8
|
+
let dllDependencies = ['library'];
|
|
9
|
+
if (bobConfig && bobConfig.hasOwnProperty('dllPackages')) {
|
|
10
|
+
bobConfig.dllPackages.forEach((dependency) => dllDependencies.push(dependency.manifest.name));
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
plugins: [
|
|
14
|
+
new webpack.LoaderOptionsPlugin({
|
|
15
|
+
minimize: true
|
|
16
|
+
}),
|
|
17
|
+
new webpack.DefinePlugin({
|
|
18
|
+
'process.env': {
|
|
19
|
+
NODE_ENV: '"production"'
|
|
20
|
+
}
|
|
21
|
+
}),
|
|
22
|
+
new cssMinimizerPlugin({
|
|
23
|
+
minimizerOptions: {
|
|
24
|
+
preset: [
|
|
25
|
+
'default',
|
|
26
|
+
{
|
|
27
|
+
discardComments: {
|
|
28
|
+
removeAll: true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
new DllAvailabilityTracker({
|
|
35
|
+
dependencies: dllDependencies || []
|
|
36
|
+
})
|
|
37
|
+
],
|
|
38
|
+
optimization: {
|
|
39
|
+
minimize: true,
|
|
40
|
+
minimizer: [
|
|
41
|
+
compiler => {
|
|
42
|
+
const TerserPlugin = require('terser-webpack-plugin');
|
|
43
|
+
new TerserPlugin({
|
|
44
|
+
parallel: true,
|
|
45
|
+
extractComments: false,
|
|
46
|
+
terserOptions: {
|
|
47
|
+
output: {
|
|
48
|
+
comments: false
|
|
49
|
+
},
|
|
50
|
+
compress: {
|
|
51
|
+
drop_console: true,
|
|
52
|
+
passes: 5
|
|
53
|
+
},
|
|
54
|
+
sourceMap: true
|
|
55
|
+
}
|
|
56
|
+
}).apply(compiler);
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
exports.ProductionConfig = ProductionConfig;
|
package/src/enums/mode.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Mode = void 0;
|
|
4
|
-
var Mode;
|
|
5
|
-
(function (Mode) {
|
|
6
|
-
Mode["DEVELOPMENT"] = "development";
|
|
7
|
-
Mode["PRODUCTION"] = "production";
|
|
8
|
-
})(Mode = exports.Mode || (exports.Mode = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mode = void 0;
|
|
4
|
+
var Mode;
|
|
5
|
+
(function (Mode) {
|
|
6
|
+
Mode["DEVELOPMENT"] = "development";
|
|
7
|
+
Mode["PRODUCTION"] = "production";
|
|
8
|
+
})(Mode = exports.Mode || (exports.Mode = {}));
|
package/src/enums/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Preset = void 0;
|
|
4
|
-
var Preset;
|
|
5
|
-
(function (Preset) {
|
|
6
|
-
Preset["VUE_TYPESCRIPT"] = "vue-typescript";
|
|
7
|
-
Preset["TYPESCRIPT"] = "typescript";
|
|
8
|
-
Preset["JAVASCRIPT"] = "javascript";
|
|
9
|
-
Preset["VUE_TYPESCRIPT_NO_CODE_SPLITTING"] = "vue-typescript-no-code-splitting";
|
|
10
|
-
})(Preset = exports.Preset || (exports.Preset = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Preset = void 0;
|
|
4
|
+
var Preset;
|
|
5
|
+
(function (Preset) {
|
|
6
|
+
Preset["VUE_TYPESCRIPT"] = "vue-typescript";
|
|
7
|
+
Preset["TYPESCRIPT"] = "typescript";
|
|
8
|
+
Preset["JAVASCRIPT"] = "javascript";
|
|
9
|
+
Preset["VUE_TYPESCRIPT_NO_CODE_SPLITTING"] = "vue-typescript-no-code-splitting";
|
|
10
|
+
})(Preset = exports.Preset || (exports.Preset = {}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfigurationFactory = void 0;
|
|
4
|
-
const configuration_1 = require("../model/configuration");
|
|
5
|
-
class ConfigurationFactory {
|
|
6
|
-
create(options) {
|
|
7
|
-
return new configuration_1.Configuration(options);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.ConfigurationFactory = ConfigurationFactory;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigurationFactory = void 0;
|
|
4
|
+
const configuration_1 = require("../model/configuration");
|
|
5
|
+
class ConfigurationFactory {
|
|
6
|
+
create(options) {
|
|
7
|
+
return new configuration_1.Configuration(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ConfigurationFactory = ConfigurationFactory;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/src/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const configuration_factory_1 = require("./factories/configuration-factory");
|
|
4
|
-
const configurationFactory = new configuration_factory_1.ConfigurationFactory();
|
|
5
|
-
module.exports = configurationFactory;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const configuration_factory_1 = require("./factories/configuration-factory");
|
|
4
|
+
const configurationFactory = new configuration_factory_1.ConfigurationFactory();
|
|
5
|
+
module.exports = configurationFactory;
|
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Configuration = void 0;
|
|
4
|
-
const entry_1 = require("./entry");
|
|
5
|
-
const output_1 = require("./output");
|
|
6
|
-
const plugins_1 = require("./plugins");
|
|
7
|
-
const module_1 = require("./module");
|
|
8
|
-
const preset_1 = require("../enums/preset");
|
|
9
|
-
const vue_typescript_preset_1 = require("../presets/vue-typescript.preset");
|
|
10
|
-
const typescript_preset_1 = require("../presets/typescript.preset");
|
|
11
|
-
const javascript_preset_1 = require("../presets/javascript.preset");
|
|
12
|
-
const vue_typescript_no_code_splitting_preset_1 = require("../presets/vue-typescript-no-code-splitting.preset");
|
|
13
|
-
const mode_1 = require("../enums/mode");
|
|
14
|
-
const production_config_1 = require("../defaults/production.config");
|
|
15
|
-
const development_config_1 = require("../defaults/development.config");
|
|
16
|
-
const ManifestGenerator = require("@studyportals/bob-manifest-generator").ManifestGenerator;
|
|
17
|
-
const DllReferencePlugin = require("@studyportals/bob-manifest-generator").DllReferencePlugin;
|
|
18
|
-
const { merge } = require('webpack-merge');
|
|
19
|
-
class Configuration {
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this.bob = options.bob || null;
|
|
22
|
-
this.entry = new entry_1.Entry(options.entry);
|
|
23
|
-
this.output = new output_1.Output(options.output);
|
|
24
|
-
this.extensions = options.extensions || [];
|
|
25
|
-
this.preset = options.preset || null;
|
|
26
|
-
this.hash = options.output.hash || false;
|
|
27
|
-
this.plugins = new plugins_1.Plugins(options.plugins);
|
|
28
|
-
this.module = new module_1.Module(options.module);
|
|
29
|
-
this.commonConfig = options.common || {};
|
|
30
|
-
const configDev = options[mode_1.Mode.DEVELOPMENT] ? options[mode_1.Mode.DEVELOPMENT] : {};
|
|
31
|
-
const configPrd = options[mode_1.Mode.PRODUCTION] ? options[mode_1.Mode.PRODUCTION] : {};
|
|
32
|
-
this.environmentSpecificConfig = {
|
|
33
|
-
[mode_1.Mode.DEVELOPMENT]: merge([configDev, development_config_1.DevelopmentConfig]) || development_config_1.DevelopmentConfig,
|
|
34
|
-
[mode_1.Mode.PRODUCTION]: merge([configPrd, (0, production_config_1.ProductionConfig)(this.bob)]) || (0, production_config_1.ProductionConfig)(this.bob)
|
|
35
|
-
};
|
|
36
|
-
this.fileName = options.output.fileName || "[name]";
|
|
37
|
-
}
|
|
38
|
-
get(mode) {
|
|
39
|
-
this.detectPresets(mode);
|
|
40
|
-
return merge({
|
|
41
|
-
entry: this.entry.getEntry(),
|
|
42
|
-
output: this.output.getOutput(),
|
|
43
|
-
plugins: this.plugins.getPlugins(),
|
|
44
|
-
module: this.module.getModule(),
|
|
45
|
-
resolve: {
|
|
46
|
-
extensions: this.extensions
|
|
47
|
-
},
|
|
48
|
-
performance: {
|
|
49
|
-
hints: false
|
|
50
|
-
},
|
|
51
|
-
optimization: {
|
|
52
|
-
minimize: false
|
|
53
|
-
},
|
|
54
|
-
devtool: 'source-map'
|
|
55
|
-
}, this.getBobConfig(), this.commonConfig, this.getEnvironmentSpecificConfig(mode), { mode });
|
|
56
|
-
}
|
|
57
|
-
detectPresets(mode) {
|
|
58
|
-
switch (this.preset) {
|
|
59
|
-
case preset_1.Preset.VUE_TYPESCRIPT:
|
|
60
|
-
this.injectPreset(new vue_typescript_preset_1.VueTypeScriptPreset(mode));
|
|
61
|
-
break;
|
|
62
|
-
case preset_1.Preset.TYPESCRIPT:
|
|
63
|
-
this.injectPreset(new typescript_preset_1.TypeScriptPreset());
|
|
64
|
-
break;
|
|
65
|
-
case preset_1.Preset.JAVASCRIPT:
|
|
66
|
-
this.injectPreset(new javascript_preset_1.JavascriptPreset());
|
|
67
|
-
break;
|
|
68
|
-
case preset_1.Preset.VUE_TYPESCRIPT_NO_CODE_SPLITTING:
|
|
69
|
-
this.injectPreset(new vue_typescript_no_code_splitting_preset_1.VueTypescriptNoCodeSplittingPreset(mode));
|
|
70
|
-
break;
|
|
71
|
-
default:
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
injectPreset(preset) {
|
|
76
|
-
const plugins = preset.getPlugins(this.getCSSFileName());
|
|
77
|
-
const module = preset.getModule();
|
|
78
|
-
plugins.forEach(plugin => {
|
|
79
|
-
this.plugins.addPlugin(plugin);
|
|
80
|
-
});
|
|
81
|
-
this.extensions = this.extensions.concat(preset.getExtensions());
|
|
82
|
-
this.module.setModule(module);
|
|
83
|
-
}
|
|
84
|
-
getEnvironmentSpecificConfig(mode) {
|
|
85
|
-
return this.environmentSpecificConfig[mode];
|
|
86
|
-
}
|
|
87
|
-
getBobConfig() {
|
|
88
|
-
if (this.bob === null) {
|
|
89
|
-
return {};
|
|
90
|
-
}
|
|
91
|
-
let dllPackages = [];
|
|
92
|
-
if (typeof this.bob.dllPackages !== 'undefined'
|
|
93
|
-
&& this.bob.dllPackages.length > 0) {
|
|
94
|
-
dllPackages = this.getBobDllDependencies();
|
|
95
|
-
delete this.bob.dllPackages;
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
plugins: [
|
|
99
|
-
new ManifestGenerator(this.bob)
|
|
100
|
-
].concat(dllPackages)
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
getBobDllDependencies() {
|
|
104
|
-
let dependencies = [];
|
|
105
|
-
if (typeof this.bob.dllPackages === 'undefined')
|
|
106
|
-
return dependencies;
|
|
107
|
-
this.bob.dllPackages.forEach((dependency) => {
|
|
108
|
-
dependencies.push(new DllReferencePlugin({
|
|
109
|
-
name: dependency.name,
|
|
110
|
-
manifest: dependency.manifest
|
|
111
|
-
}));
|
|
112
|
-
});
|
|
113
|
-
return dependencies;
|
|
114
|
-
}
|
|
115
|
-
getCSSFileName() {
|
|
116
|
-
const fileName = this.fileName || `style`;
|
|
117
|
-
if (this.hash === false
|
|
118
|
-
|| typeof this.hash.css !== 'undefined'
|
|
119
|
-
&& this.hash.css === false) {
|
|
120
|
-
return `${fileName}.css`;
|
|
121
|
-
}
|
|
122
|
-
return `${fileName}.[fullhash].css`;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
exports.Configuration = Configuration;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Configuration = void 0;
|
|
4
|
+
const entry_1 = require("./entry");
|
|
5
|
+
const output_1 = require("./output");
|
|
6
|
+
const plugins_1 = require("./plugins");
|
|
7
|
+
const module_1 = require("./module");
|
|
8
|
+
const preset_1 = require("../enums/preset");
|
|
9
|
+
const vue_typescript_preset_1 = require("../presets/vue-typescript.preset");
|
|
10
|
+
const typescript_preset_1 = require("../presets/typescript.preset");
|
|
11
|
+
const javascript_preset_1 = require("../presets/javascript.preset");
|
|
12
|
+
const vue_typescript_no_code_splitting_preset_1 = require("../presets/vue-typescript-no-code-splitting.preset");
|
|
13
|
+
const mode_1 = require("../enums/mode");
|
|
14
|
+
const production_config_1 = require("../defaults/production.config");
|
|
15
|
+
const development_config_1 = require("../defaults/development.config");
|
|
16
|
+
const ManifestGenerator = require("@studyportals/bob-manifest-generator").ManifestGenerator;
|
|
17
|
+
const DllReferencePlugin = require("@studyportals/bob-manifest-generator").DllReferencePlugin;
|
|
18
|
+
const { merge } = require('webpack-merge');
|
|
19
|
+
class Configuration {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this.bob = options.bob || null;
|
|
22
|
+
this.entry = new entry_1.Entry(options.entry);
|
|
23
|
+
this.output = new output_1.Output(options.output);
|
|
24
|
+
this.extensions = options.extensions || [];
|
|
25
|
+
this.preset = options.preset || null;
|
|
26
|
+
this.hash = options.output.hash || false;
|
|
27
|
+
this.plugins = new plugins_1.Plugins(options.plugins);
|
|
28
|
+
this.module = new module_1.Module(options.module);
|
|
29
|
+
this.commonConfig = options.common || {};
|
|
30
|
+
const configDev = options[mode_1.Mode.DEVELOPMENT] ? options[mode_1.Mode.DEVELOPMENT] : {};
|
|
31
|
+
const configPrd = options[mode_1.Mode.PRODUCTION] ? options[mode_1.Mode.PRODUCTION] : {};
|
|
32
|
+
this.environmentSpecificConfig = {
|
|
33
|
+
[mode_1.Mode.DEVELOPMENT]: merge([configDev, development_config_1.DevelopmentConfig]) || development_config_1.DevelopmentConfig,
|
|
34
|
+
[mode_1.Mode.PRODUCTION]: merge([configPrd, (0, production_config_1.ProductionConfig)(this.bob)]) || (0, production_config_1.ProductionConfig)(this.bob)
|
|
35
|
+
};
|
|
36
|
+
this.fileName = options.output.fileName || "[name]";
|
|
37
|
+
}
|
|
38
|
+
get(mode) {
|
|
39
|
+
this.detectPresets(mode);
|
|
40
|
+
return merge({
|
|
41
|
+
entry: this.entry.getEntry(),
|
|
42
|
+
output: this.output.getOutput(),
|
|
43
|
+
plugins: this.plugins.getPlugins(),
|
|
44
|
+
module: this.module.getModule(),
|
|
45
|
+
resolve: {
|
|
46
|
+
extensions: this.extensions
|
|
47
|
+
},
|
|
48
|
+
performance: {
|
|
49
|
+
hints: false
|
|
50
|
+
},
|
|
51
|
+
optimization: {
|
|
52
|
+
minimize: false
|
|
53
|
+
},
|
|
54
|
+
devtool: 'source-map'
|
|
55
|
+
}, this.getBobConfig(), this.commonConfig, this.getEnvironmentSpecificConfig(mode), { mode });
|
|
56
|
+
}
|
|
57
|
+
detectPresets(mode) {
|
|
58
|
+
switch (this.preset) {
|
|
59
|
+
case preset_1.Preset.VUE_TYPESCRIPT:
|
|
60
|
+
this.injectPreset(new vue_typescript_preset_1.VueTypeScriptPreset(mode));
|
|
61
|
+
break;
|
|
62
|
+
case preset_1.Preset.TYPESCRIPT:
|
|
63
|
+
this.injectPreset(new typescript_preset_1.TypeScriptPreset());
|
|
64
|
+
break;
|
|
65
|
+
case preset_1.Preset.JAVASCRIPT:
|
|
66
|
+
this.injectPreset(new javascript_preset_1.JavascriptPreset());
|
|
67
|
+
break;
|
|
68
|
+
case preset_1.Preset.VUE_TYPESCRIPT_NO_CODE_SPLITTING:
|
|
69
|
+
this.injectPreset(new vue_typescript_no_code_splitting_preset_1.VueTypescriptNoCodeSplittingPreset(mode));
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
injectPreset(preset) {
|
|
76
|
+
const plugins = preset.getPlugins(this.getCSSFileName());
|
|
77
|
+
const module = preset.getModule();
|
|
78
|
+
plugins.forEach(plugin => {
|
|
79
|
+
this.plugins.addPlugin(plugin);
|
|
80
|
+
});
|
|
81
|
+
this.extensions = this.extensions.concat(preset.getExtensions());
|
|
82
|
+
this.module.setModule(module);
|
|
83
|
+
}
|
|
84
|
+
getEnvironmentSpecificConfig(mode) {
|
|
85
|
+
return this.environmentSpecificConfig[mode];
|
|
86
|
+
}
|
|
87
|
+
getBobConfig() {
|
|
88
|
+
if (this.bob === null) {
|
|
89
|
+
return {};
|
|
90
|
+
}
|
|
91
|
+
let dllPackages = [];
|
|
92
|
+
if (typeof this.bob.dllPackages !== 'undefined'
|
|
93
|
+
&& this.bob.dllPackages.length > 0) {
|
|
94
|
+
dllPackages = this.getBobDllDependencies();
|
|
95
|
+
delete this.bob.dllPackages;
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
plugins: [
|
|
99
|
+
new ManifestGenerator(this.bob)
|
|
100
|
+
].concat(dllPackages)
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
getBobDllDependencies() {
|
|
104
|
+
let dependencies = [];
|
|
105
|
+
if (typeof this.bob.dllPackages === 'undefined')
|
|
106
|
+
return dependencies;
|
|
107
|
+
this.bob.dllPackages.forEach((dependency) => {
|
|
108
|
+
dependencies.push(new DllReferencePlugin({
|
|
109
|
+
name: dependency.name,
|
|
110
|
+
manifest: dependency.manifest
|
|
111
|
+
}));
|
|
112
|
+
});
|
|
113
|
+
return dependencies;
|
|
114
|
+
}
|
|
115
|
+
getCSSFileName() {
|
|
116
|
+
const fileName = this.fileName || `style`;
|
|
117
|
+
if (this.hash === false
|
|
118
|
+
|| typeof this.hash.css !== 'undefined'
|
|
119
|
+
&& this.hash.css === false) {
|
|
120
|
+
return `${fileName}.css`;
|
|
121
|
+
}
|
|
122
|
+
return `${fileName}.[fullhash].css`;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.Configuration = Configuration;
|
package/src/model/entry.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Entry = void 0;
|
|
4
|
-
class Entry {
|
|
5
|
-
constructor(entry) {
|
|
6
|
-
this.entry = entry;
|
|
7
|
-
}
|
|
8
|
-
getEntry() {
|
|
9
|
-
return this.entry;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.Entry = Entry;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Entry = void 0;
|
|
4
|
+
class Entry {
|
|
5
|
+
constructor(entry) {
|
|
6
|
+
this.entry = entry;
|
|
7
|
+
}
|
|
8
|
+
getEntry() {
|
|
9
|
+
return this.entry;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.Entry = Entry;
|
package/src/model/module.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Module = void 0;
|
|
4
|
-
const { merge } = require('webpack-merge');
|
|
5
|
-
class Module {
|
|
6
|
-
constructor(module = {}) {
|
|
7
|
-
this.module = {};
|
|
8
|
-
this.module = merge(this.module, module);
|
|
9
|
-
}
|
|
10
|
-
setModule(module) {
|
|
11
|
-
this.module = merge(this.module, module);
|
|
12
|
-
}
|
|
13
|
-
getModule() {
|
|
14
|
-
return this.module;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.Module = Module;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Module = void 0;
|
|
4
|
+
const { merge } = require('webpack-merge');
|
|
5
|
+
class Module {
|
|
6
|
+
constructor(module = {}) {
|
|
7
|
+
this.module = {};
|
|
8
|
+
this.module = merge(this.module, module);
|
|
9
|
+
}
|
|
10
|
+
setModule(module) {
|
|
11
|
+
this.module = merge(this.module, module);
|
|
12
|
+
}
|
|
13
|
+
getModule() {
|
|
14
|
+
return this.module;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.Module = Module;
|
package/src/model/output.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Output = void 0;
|
|
4
|
-
class Output {
|
|
5
|
-
constructor(outputConfig) {
|
|
6
|
-
this.path = outputConfig.path;
|
|
7
|
-
this.publicPath = typeof outputConfig.publicPath === "string" ? outputConfig.publicPath : null;
|
|
8
|
-
this.library = outputConfig.library || null;
|
|
9
|
-
this.addHash = this.shouldAddHash(outputConfig.hash),
|
|
10
|
-
this.fileName = outputConfig.fileName || "[name]";
|
|
11
|
-
this.crossOriginLoading = outputConfig.crossOriginLoading || null;
|
|
12
|
-
}
|
|
13
|
-
getOutput() {
|
|
14
|
-
let output = {
|
|
15
|
-
path: this.path,
|
|
16
|
-
filename: this.getFileName()
|
|
17
|
-
};
|
|
18
|
-
if (this.publicPath !== null) {
|
|
19
|
-
output.publicPath = this.publicPath;
|
|
20
|
-
}
|
|
21
|
-
if (this.library !== null) {
|
|
22
|
-
output.library = this.library;
|
|
23
|
-
}
|
|
24
|
-
if (this.crossOriginLoading !== null) {
|
|
25
|
-
output.crossOriginLoading = this.crossOriginLoading;
|
|
26
|
-
}
|
|
27
|
-
return output;
|
|
28
|
-
}
|
|
29
|
-
getFileName() {
|
|
30
|
-
let fileName = this.addHash === true ? `${this.fileName}.[fullhash].js` : `${this.fileName}.js`;
|
|
31
|
-
return fileName;
|
|
32
|
-
}
|
|
33
|
-
shouldAddHash(hashConfig) {
|
|
34
|
-
if (typeof hashConfig === 'undefined') {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
if (typeof hashConfig.js !== 'undefined'
|
|
38
|
-
&& hashConfig.js === false
|
|
39
|
-
|| hashConfig === false) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.Output = Output;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Output = void 0;
|
|
4
|
+
class Output {
|
|
5
|
+
constructor(outputConfig) {
|
|
6
|
+
this.path = outputConfig.path;
|
|
7
|
+
this.publicPath = typeof outputConfig.publicPath === "string" ? outputConfig.publicPath : null;
|
|
8
|
+
this.library = outputConfig.library || null;
|
|
9
|
+
this.addHash = this.shouldAddHash(outputConfig.hash),
|
|
10
|
+
this.fileName = outputConfig.fileName || "[name]";
|
|
11
|
+
this.crossOriginLoading = outputConfig.crossOriginLoading || null;
|
|
12
|
+
}
|
|
13
|
+
getOutput() {
|
|
14
|
+
let output = {
|
|
15
|
+
path: this.path,
|
|
16
|
+
filename: this.getFileName()
|
|
17
|
+
};
|
|
18
|
+
if (this.publicPath !== null) {
|
|
19
|
+
output.publicPath = this.publicPath;
|
|
20
|
+
}
|
|
21
|
+
if (this.library !== null) {
|
|
22
|
+
output.library = this.library;
|
|
23
|
+
}
|
|
24
|
+
if (this.crossOriginLoading !== null) {
|
|
25
|
+
output.crossOriginLoading = this.crossOriginLoading;
|
|
26
|
+
}
|
|
27
|
+
return output;
|
|
28
|
+
}
|
|
29
|
+
getFileName() {
|
|
30
|
+
let fileName = this.addHash === true ? `${this.fileName}.[fullhash].js` : `${this.fileName}.js`;
|
|
31
|
+
return fileName;
|
|
32
|
+
}
|
|
33
|
+
shouldAddHash(hashConfig) {
|
|
34
|
+
if (typeof hashConfig === 'undefined') {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
if (typeof hashConfig.js !== 'undefined'
|
|
38
|
+
&& hashConfig.js === false
|
|
39
|
+
|| hashConfig === false) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.Output = Output;
|
package/src/model/plugins.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Plugins = void 0;
|
|
4
|
-
class Plugins {
|
|
5
|
-
constructor(plugins = []) {
|
|
6
|
-
this.plugins = [];
|
|
7
|
-
this.plugins = this.plugins.concat(plugins);
|
|
8
|
-
}
|
|
9
|
-
addPlugin(plugin) {
|
|
10
|
-
this.plugins.push(plugin);
|
|
11
|
-
}
|
|
12
|
-
getPlugins() {
|
|
13
|
-
return this.plugins;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.Plugins = Plugins;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Plugins = void 0;
|
|
4
|
+
class Plugins {
|
|
5
|
+
constructor(plugins = []) {
|
|
6
|
+
this.plugins = [];
|
|
7
|
+
this.plugins = this.plugins.concat(plugins);
|
|
8
|
+
}
|
|
9
|
+
addPlugin(plugin) {
|
|
10
|
+
this.plugins.push(plugin);
|
|
11
|
+
}
|
|
12
|
+
getPlugins() {
|
|
13
|
+
return this.plugins;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.Plugins = Plugins;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JavascriptPreset = void 0;
|
|
4
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
|
-
class JavascriptPreset {
|
|
6
|
-
getPlugins(filename) {
|
|
7
|
-
return [
|
|
8
|
-
new MiniCssExtractPlugin({
|
|
9
|
-
filename
|
|
10
|
-
})
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
getModule() {
|
|
14
|
-
return {
|
|
15
|
-
rules: [
|
|
16
|
-
{
|
|
17
|
-
test: /\.css$/,
|
|
18
|
-
use: [
|
|
19
|
-
MiniCssExtractPlugin.loader,
|
|
20
|
-
'css-loader'
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
test: /\.scss$/,
|
|
25
|
-
use: [
|
|
26
|
-
MiniCssExtractPlugin.loader,
|
|
27
|
-
'css-loader',
|
|
28
|
-
'sass-loader'
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
test: /\.jsx?$/,
|
|
33
|
-
loader: 'babel-loader',
|
|
34
|
-
exclude: /node_modules\/(?!@studyportals\/).*/,
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
getExtensions() {
|
|
40
|
-
return [
|
|
41
|
-
'*',
|
|
42
|
-
'.js',
|
|
43
|
-
'.json'
|
|
44
|
-
];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.JavascriptPreset = JavascriptPreset;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JavascriptPreset = void 0;
|
|
4
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
|
+
class JavascriptPreset {
|
|
6
|
+
getPlugins(filename) {
|
|
7
|
+
return [
|
|
8
|
+
new MiniCssExtractPlugin({
|
|
9
|
+
filename
|
|
10
|
+
})
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
getModule() {
|
|
14
|
+
return {
|
|
15
|
+
rules: [
|
|
16
|
+
{
|
|
17
|
+
test: /\.css$/,
|
|
18
|
+
use: [
|
|
19
|
+
MiniCssExtractPlugin.loader,
|
|
20
|
+
'css-loader'
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
test: /\.scss$/,
|
|
25
|
+
use: [
|
|
26
|
+
MiniCssExtractPlugin.loader,
|
|
27
|
+
'css-loader',
|
|
28
|
+
'sass-loader'
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
test: /\.jsx?$/,
|
|
33
|
+
loader: 'babel-loader',
|
|
34
|
+
exclude: /node_modules\/(?!@studyportals\/).*/,
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
getExtensions() {
|
|
40
|
+
return [
|
|
41
|
+
'*',
|
|
42
|
+
'.js',
|
|
43
|
+
'.json'
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.JavascriptPreset = JavascriptPreset;
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeScriptPreset = void 0;
|
|
4
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
|
-
class TypeScriptPreset {
|
|
6
|
-
getPlugins(filename) {
|
|
7
|
-
return [
|
|
8
|
-
new MiniCssExtractPlugin({
|
|
9
|
-
filename
|
|
10
|
-
})
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
getModule() {
|
|
14
|
-
return {
|
|
15
|
-
rules: [
|
|
16
|
-
{
|
|
17
|
-
test: /\.css$/,
|
|
18
|
-
use: [
|
|
19
|
-
MiniCssExtractPlugin.loader,
|
|
20
|
-
'css-loader'
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
test: /\.scss$/,
|
|
25
|
-
use: [
|
|
26
|
-
MiniCssExtractPlugin.loader,
|
|
27
|
-
'css-loader',
|
|
28
|
-
'sass-loader'
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
test: /\.tsx?$/,
|
|
33
|
-
exclude: /node_modules\/(?!@studyportals\/).*/,
|
|
34
|
-
use: [
|
|
35
|
-
{
|
|
36
|
-
loader: 'babel-loader',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
loader: 'ts-loader'
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
test: /\.js$/,
|
|
45
|
-
exclude: /node_modules\/(?!@studyportals\/).*/,
|
|
46
|
-
use: [
|
|
47
|
-
{
|
|
48
|
-
loader: 'babel-loader',
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
resolve: {
|
|
52
|
-
fullySpecified: false
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
test: /\.(png|jpg|gif|svg)$/,
|
|
57
|
-
loader: 'file-loader',
|
|
58
|
-
options: {
|
|
59
|
-
name: '[name].[ext]?[fullhash]'
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
getExtensions() {
|
|
66
|
-
return [
|
|
67
|
-
'*',
|
|
68
|
-
'.ts',
|
|
69
|
-
'.js',
|
|
70
|
-
'.json'
|
|
71
|
-
];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.TypeScriptPreset = TypeScriptPreset;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeScriptPreset = void 0;
|
|
4
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
|
+
class TypeScriptPreset {
|
|
6
|
+
getPlugins(filename) {
|
|
7
|
+
return [
|
|
8
|
+
new MiniCssExtractPlugin({
|
|
9
|
+
filename
|
|
10
|
+
})
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
getModule() {
|
|
14
|
+
return {
|
|
15
|
+
rules: [
|
|
16
|
+
{
|
|
17
|
+
test: /\.css$/,
|
|
18
|
+
use: [
|
|
19
|
+
MiniCssExtractPlugin.loader,
|
|
20
|
+
'css-loader'
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
test: /\.scss$/,
|
|
25
|
+
use: [
|
|
26
|
+
MiniCssExtractPlugin.loader,
|
|
27
|
+
'css-loader',
|
|
28
|
+
'sass-loader'
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
test: /\.tsx?$/,
|
|
33
|
+
exclude: /node_modules\/(?!@studyportals\/).*/,
|
|
34
|
+
use: [
|
|
35
|
+
{
|
|
36
|
+
loader: 'babel-loader',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
loader: 'ts-loader'
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
test: /\.js$/,
|
|
45
|
+
exclude: /node_modules\/(?!@studyportals\/).*/,
|
|
46
|
+
use: [
|
|
47
|
+
{
|
|
48
|
+
loader: 'babel-loader',
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
resolve: {
|
|
52
|
+
fullySpecified: false
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
test: /\.(png|jpg|gif|svg)$/,
|
|
57
|
+
loader: 'file-loader',
|
|
58
|
+
options: {
|
|
59
|
+
name: '[name].[ext]?[fullhash]'
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
getExtensions() {
|
|
66
|
+
return [
|
|
67
|
+
'*',
|
|
68
|
+
'.ts',
|
|
69
|
+
'.js',
|
|
70
|
+
'.json'
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.TypeScriptPreset = TypeScriptPreset;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VueTypescriptNoCodeSplittingPreset = void 0;
|
|
4
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
|
-
const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
|
|
6
|
-
const vue_typescript_preset_1 = require("./vue-typescript.preset");
|
|
7
|
-
class VueTypescriptNoCodeSplittingPreset extends vue_typescript_preset_1.VueTypeScriptPreset {
|
|
8
|
-
constructor(mode) {
|
|
9
|
-
super(mode);
|
|
10
|
-
}
|
|
11
|
-
getPlugins(filename) {
|
|
12
|
-
return [
|
|
13
|
-
new MiniCssExtractPlugin({
|
|
14
|
-
filename
|
|
15
|
-
}),
|
|
16
|
-
new VueLoaderPlugin()
|
|
17
|
-
];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.VueTypescriptNoCodeSplittingPreset = VueTypescriptNoCodeSplittingPreset;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VueTypescriptNoCodeSplittingPreset = void 0;
|
|
4
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
|
+
const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
|
|
6
|
+
const vue_typescript_preset_1 = require("./vue-typescript.preset");
|
|
7
|
+
class VueTypescriptNoCodeSplittingPreset extends vue_typescript_preset_1.VueTypeScriptPreset {
|
|
8
|
+
constructor(mode) {
|
|
9
|
+
super(mode);
|
|
10
|
+
}
|
|
11
|
+
getPlugins(filename) {
|
|
12
|
+
return [
|
|
13
|
+
new MiniCssExtractPlugin({
|
|
14
|
+
filename
|
|
15
|
+
}),
|
|
16
|
+
new VueLoaderPlugin()
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.VueTypescriptNoCodeSplittingPreset = VueTypescriptNoCodeSplittingPreset;
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VueTypeScriptPreset = void 0;
|
|
4
|
-
const mode_1 = require("../enums/mode");
|
|
5
|
-
const webpack = require("webpack");
|
|
6
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
7
|
-
const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
|
|
8
|
-
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
9
|
-
class VueTypeScriptPreset {
|
|
10
|
-
constructor(mode) {
|
|
11
|
-
this.mode = mode;
|
|
12
|
-
}
|
|
13
|
-
getPlugins(filename) {
|
|
14
|
-
return [
|
|
15
|
-
new ForkTsCheckerWebpackPlugin(),
|
|
16
|
-
new webpack.DllReferencePlugin({
|
|
17
|
-
manifest: require(`@studyportals/vue-config/dist/vue3_library_v5${this.mode === mode_1.Mode.PRODUCTION ? '.min' : ''}.json`)
|
|
18
|
-
}),
|
|
19
|
-
new MiniCssExtractPlugin({
|
|
20
|
-
filename,
|
|
21
|
-
ignoreOrder: true
|
|
22
|
-
}),
|
|
23
|
-
new VueLoaderPlugin()
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
getModule() {
|
|
27
|
-
return {
|
|
28
|
-
rules: [
|
|
29
|
-
{
|
|
30
|
-
test: /\.css$/,
|
|
31
|
-
use: [
|
|
32
|
-
MiniCssExtractPlugin.loader,
|
|
33
|
-
'css-loader'
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
test: /\.scss$/,
|
|
38
|
-
use: [
|
|
39
|
-
MiniCssExtractPlugin.loader,
|
|
40
|
-
'css-loader',
|
|
41
|
-
'sass-loader'
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
test: /\.vue$/,
|
|
46
|
-
loader: 'vue-loader',
|
|
47
|
-
options: {
|
|
48
|
-
loaders: {
|
|
49
|
-
'scss': [
|
|
50
|
-
'vue-style-loader',
|
|
51
|
-
'css-loader',
|
|
52
|
-
'sass-loader'
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
hotReload: false
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
test: /\.tsx?$/,
|
|
60
|
-
use: [
|
|
61
|
-
{
|
|
62
|
-
loader: 'babel-loader'
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
loader: 'ts-loader',
|
|
66
|
-
options: {
|
|
67
|
-
appendTsSuffixTo: [/\.vue$/]
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
exclude: /node_modules\/(?!@studyportals\/).*/
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
test: /\.js$/,
|
|
75
|
-
use: [
|
|
76
|
-
{
|
|
77
|
-
loader: 'babel-loader'
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
resolve: {
|
|
81
|
-
fullySpecified: false
|
|
82
|
-
},
|
|
83
|
-
exclude: /node_modules\/(?!@studyportals\/).*/
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
test: /\.(png|jpg|gif|svg)$/,
|
|
87
|
-
loader: 'file-loader',
|
|
88
|
-
options: {
|
|
89
|
-
name: '[name].[ext]?[fullhash]'
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
]
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
getExtensions() {
|
|
96
|
-
return [
|
|
97
|
-
'*',
|
|
98
|
-
'.ts',
|
|
99
|
-
'.js',
|
|
100
|
-
'.vue',
|
|
101
|
-
'.json'
|
|
102
|
-
];
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
exports.VueTypeScriptPreset = VueTypeScriptPreset;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VueTypeScriptPreset = void 0;
|
|
4
|
+
const mode_1 = require("../enums/mode");
|
|
5
|
+
const webpack = require("webpack");
|
|
6
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
7
|
+
const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
|
|
8
|
+
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
9
|
+
class VueTypeScriptPreset {
|
|
10
|
+
constructor(mode) {
|
|
11
|
+
this.mode = mode;
|
|
12
|
+
}
|
|
13
|
+
getPlugins(filename) {
|
|
14
|
+
return [
|
|
15
|
+
new ForkTsCheckerWebpackPlugin(),
|
|
16
|
+
new webpack.DllReferencePlugin({
|
|
17
|
+
manifest: require(`@studyportals/vue-config/dist/vue3_library_v5${this.mode === mode_1.Mode.PRODUCTION ? '.min' : ''}.json`)
|
|
18
|
+
}),
|
|
19
|
+
new MiniCssExtractPlugin({
|
|
20
|
+
filename,
|
|
21
|
+
ignoreOrder: true
|
|
22
|
+
}),
|
|
23
|
+
new VueLoaderPlugin()
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
getModule() {
|
|
27
|
+
return {
|
|
28
|
+
rules: [
|
|
29
|
+
{
|
|
30
|
+
test: /\.css$/,
|
|
31
|
+
use: [
|
|
32
|
+
MiniCssExtractPlugin.loader,
|
|
33
|
+
'css-loader'
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
test: /\.scss$/,
|
|
38
|
+
use: [
|
|
39
|
+
MiniCssExtractPlugin.loader,
|
|
40
|
+
'css-loader',
|
|
41
|
+
'sass-loader'
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
test: /\.vue$/,
|
|
46
|
+
loader: 'vue-loader',
|
|
47
|
+
options: {
|
|
48
|
+
loaders: {
|
|
49
|
+
'scss': [
|
|
50
|
+
'vue-style-loader',
|
|
51
|
+
'css-loader',
|
|
52
|
+
'sass-loader'
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
hotReload: false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
test: /\.tsx?$/,
|
|
60
|
+
use: [
|
|
61
|
+
{
|
|
62
|
+
loader: 'babel-loader'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
loader: 'ts-loader',
|
|
66
|
+
options: {
|
|
67
|
+
appendTsSuffixTo: [/\.vue$/]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
exclude: /node_modules\/(?!@studyportals\/).*/
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
test: /\.js$/,
|
|
75
|
+
use: [
|
|
76
|
+
{
|
|
77
|
+
loader: 'babel-loader'
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
resolve: {
|
|
81
|
+
fullySpecified: false
|
|
82
|
+
},
|
|
83
|
+
exclude: /node_modules\/(?!@studyportals\/).*/
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
test: /\.(png|jpg|gif|svg)$/,
|
|
87
|
+
loader: 'file-loader',
|
|
88
|
+
options: {
|
|
89
|
+
name: '[name].[ext]?[fullhash]'
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
]
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
getExtensions() {
|
|
96
|
+
return [
|
|
97
|
+
'*',
|
|
98
|
+
'.ts',
|
|
99
|
+
'.js',
|
|
100
|
+
'.vue',
|
|
101
|
+
'.json'
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.VueTypeScriptPreset = VueTypeScriptPreset;
|