@elliemae/pui-cli 6.0.0-beta.53 → 6.0.0-beta.54
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/lib/webpack/helpers.js
CHANGED
|
@@ -218,6 +218,12 @@ const getCompressionPlugins = (isLibrary = false) => {
|
|
|
218
218
|
];
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
+
const filterByFilePresence = (patterns) =>
|
|
222
|
+
patterns.filter(
|
|
223
|
+
({ from, noErrorOnMissing }) =>
|
|
224
|
+
!noErrorOnMissing || fs.existsSync(path.resolve(process.cwd(), from)),
|
|
225
|
+
);
|
|
226
|
+
|
|
221
227
|
exports.excludeNodeModulesExcept = excludeNodeModulesExcept;
|
|
222
228
|
exports.getLibraryName = getLibraryName;
|
|
223
229
|
exports.getAppConfig = getAppConfig;
|
|
@@ -243,3 +249,4 @@ exports.resolveExtensions = [
|
|
|
243
249
|
exports.mainFields = ['browser', 'module', 'main'];
|
|
244
250
|
exports.isGoogleTagManagerEnabled = isGoogleTagManagerEnabled;
|
|
245
251
|
exports.getCompressionPlugins = getCompressionPlugins;
|
|
252
|
+
exports.filterByFilePresence = filterByFilePresence;
|
|
@@ -16,6 +16,7 @@ const {
|
|
|
16
16
|
modulesToTranspile,
|
|
17
17
|
getAlias,
|
|
18
18
|
getPaths,
|
|
19
|
+
filterByFilePresence,
|
|
19
20
|
} = require('./helpers');
|
|
20
21
|
|
|
21
22
|
const minicssLoader = {
|
|
@@ -43,7 +44,7 @@ const plugins = [
|
|
|
43
44
|
React: 'react',
|
|
44
45
|
}),
|
|
45
46
|
new CopyWebpackPlugin({
|
|
46
|
-
patterns: [
|
|
47
|
+
patterns: filterByFilePresence([
|
|
47
48
|
{
|
|
48
49
|
from: 'app/app.config.json',
|
|
49
50
|
to: 'app.config.json',
|
|
@@ -85,15 +86,21 @@ const plugins = [
|
|
|
85
86
|
info: { minimized: true },
|
|
86
87
|
},
|
|
87
88
|
{
|
|
88
|
-
from: '
|
|
89
|
+
from: 'public',
|
|
89
90
|
noErrorOnMissing: true,
|
|
91
|
+
globOptions: {
|
|
92
|
+
ignore: ['readme.md'],
|
|
93
|
+
},
|
|
90
94
|
},
|
|
91
95
|
{
|
|
92
|
-
from: '
|
|
96
|
+
from: 'webroot',
|
|
93
97
|
to: '../',
|
|
94
98
|
noErrorOnMissing: true,
|
|
99
|
+
globOptions: {
|
|
100
|
+
ignore: ['readme.md'],
|
|
101
|
+
},
|
|
95
102
|
},
|
|
96
|
-
],
|
|
103
|
+
]),
|
|
97
104
|
}),
|
|
98
105
|
new DuplicatePackageCheckerPlugin(),
|
|
99
106
|
new MomentLocalesPlugin({ localesToKeep: ['es-us'] }),
|