@angular-devkit/build-angular 14.0.0-rc.2 → 14.0.0-rc.3
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
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "14.0.0-rc.
|
|
3
|
+
"version": "14.0.0-rc.3",
|
|
4
4
|
"description": "Angular Webpack Build Facade",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
7
7
|
"builders": "builders.json",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@ampproject/remapping": "2.2.0",
|
|
10
|
-
"@angular-devkit/architect": "0.1400.0-rc.
|
|
11
|
-
"@angular-devkit/build-webpack": "0.1400.0-rc.
|
|
12
|
-
"@angular-devkit/core": "14.0.0-rc.
|
|
10
|
+
"@angular-devkit/architect": "0.1400.0-rc.3",
|
|
11
|
+
"@angular-devkit/build-webpack": "0.1400.0-rc.3",
|
|
12
|
+
"@angular-devkit/core": "14.0.0-rc.3",
|
|
13
13
|
"@babel/core": "7.17.10",
|
|
14
14
|
"@babel/generator": "7.17.10",
|
|
15
15
|
"@babel/helper-annotate-as-pure": "7.16.7",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@babel/runtime": "7.17.9",
|
|
21
21
|
"@babel/template": "7.16.7",
|
|
22
22
|
"@discoveryjs/json-ext": "0.5.7",
|
|
23
|
-
"@ngtools/webpack": "14.0.0-rc.
|
|
23
|
+
"@ngtools/webpack": "14.0.0-rc.3",
|
|
24
24
|
"ansi-colors": "4.1.1",
|
|
25
25
|
"babel-loader": "8.2.5",
|
|
26
26
|
"babel-plugin-istanbul": "6.1.1",
|
|
@@ -224,7 +224,7 @@ async function bundleCode(workspaceRoot, entryPoints, outputNames, options, opti
|
|
|
224
224
|
assetNames: outputNames.media,
|
|
225
225
|
target: 'es2020',
|
|
226
226
|
mainFields: ['es2020', 'browser', 'module', 'main'],
|
|
227
|
-
conditions: ['es2020', 'module'],
|
|
227
|
+
conditions: ['es2020', 'es2015', 'module'],
|
|
228
228
|
resolveExtensions: ['.ts', '.tsx', '.mjs', '.js'],
|
|
229
229
|
logLevel: options.verbose ? 'debug' : 'silent',
|
|
230
230
|
metafile: true,
|
|
@@ -110,19 +110,10 @@ function getStylesConfig(wco) {
|
|
|
110
110
|
const assetNameTemplate = (0, helpers_1.assetNameTemplateFactory)(hashFormat);
|
|
111
111
|
const extraPostcssPlugins = [];
|
|
112
112
|
// Attempt to setup Tailwind CSS
|
|
113
|
-
// A configuration file can exist in the project or workspace root
|
|
114
|
-
const tailwindConfigFile = 'tailwind.config.js';
|
|
115
|
-
let tailwindConfigPath;
|
|
116
|
-
for (const basePath of [wco.projectRoot, wco.root]) {
|
|
117
|
-
const fullPath = path.join(basePath, tailwindConfigFile);
|
|
118
|
-
if (fs.existsSync(fullPath)) {
|
|
119
|
-
tailwindConfigPath = fullPath;
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
113
|
// Only load Tailwind CSS plugin if configuration file was found.
|
|
124
114
|
// This acts as a guard to ensure the project actually wants to use Tailwind CSS.
|
|
125
115
|
// The package may be unknowningly present due to a third-party transitive package dependency.
|
|
116
|
+
const tailwindConfigPath = getTailwindConfigPath(wco);
|
|
126
117
|
if (tailwindConfigPath) {
|
|
127
118
|
let tailwindPackagePath;
|
|
128
119
|
try {
|
|
@@ -374,3 +365,19 @@ function getStylesConfig(wco) {
|
|
|
374
365
|
};
|
|
375
366
|
}
|
|
376
367
|
exports.getStylesConfig = getStylesConfig;
|
|
368
|
+
function getTailwindConfigPath({ projectRoot, root }) {
|
|
369
|
+
// A configuration file can exist in the project or workspace root
|
|
370
|
+
// The list of valid config files can be found:
|
|
371
|
+
// https://github.com/tailwindlabs/tailwindcss/blob/8845d112fb62d79815b50b3bae80c317450b8b92/src/util/resolveConfigPath.js#L46-L52
|
|
372
|
+
const tailwindConfigFiles = ['tailwind.config.js', 'tailwind.config.cjs'];
|
|
373
|
+
for (const basePath of [projectRoot, root]) {
|
|
374
|
+
for (const configFile of tailwindConfigFiles) {
|
|
375
|
+
// Irrespective of the name project level configuration should always take precedence.
|
|
376
|
+
const fullPath = path.join(basePath, configFile);
|
|
377
|
+
if (fs.existsSync(fullPath)) {
|
|
378
|
+
return fullPath;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return undefined;
|
|
383
|
+
}
|