@embroider/addon-dev 4.1.1-unstable.17cf74c → 4.1.1-unstable.45736c1
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embroider/addon-dev",
|
|
3
|
-
"version": "4.1.1-unstable.
|
|
3
|
+
"version": "4.1.1-unstable.45736c1",
|
|
4
4
|
"description": "Utilities for addon authors",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "jest"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@embroider/core": "3.2.2-unstable.
|
|
29
|
+
"@embroider/core": "3.2.2-unstable.45736c1",
|
|
30
30
|
"@rollup/pluginutils": "^4.1.1",
|
|
31
31
|
"content-tag": "^1.0.0",
|
|
32
32
|
"fs-extra": "^10.0.0",
|
|
@@ -18,8 +18,9 @@ function keepAssets({ from, include, }) {
|
|
|
18
18
|
...options,
|
|
19
19
|
});
|
|
20
20
|
if (resolution &&
|
|
21
|
+
importer &&
|
|
21
22
|
include.some((pattern) => (0, minimatch_1.default)(resolution.id, pattern))) {
|
|
22
|
-
return { id: source, external:
|
|
23
|
+
return { id: (0, path_1.resolve)((0, path_1.dirname)(importer), source), external: 'relative' };
|
|
23
24
|
}
|
|
24
25
|
return resolution;
|
|
25
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-keep-assets.js","sourceRoot":"","sources":["rollup-keep-assets.ts"],"names":[],"mappings":";;;;;AAAA,0DAAiC;AAEjC,2BAAkC;AAClC,+
|
|
1
|
+
{"version":3,"file":"rollup-keep-assets.js","sourceRoot":"","sources":["rollup-keep-assets.ts"],"names":[],"mappings":";;;;;AAAA,0DAAiC;AAEjC,2BAAkC;AAClC,+BAA8C;AAC9C,0DAAkC;AAElC,SAAwB,UAAU,CAAC,EACjC,IAAI,EACJ,OAAO,GAIR;IACC,OAAO;QACL,IAAI,EAAE,aAAa;QAEnB,4EAA4E;QAC5E,8DAA8D;QAC9D,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO;YACvC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE;gBACtD,QAAQ,EAAE,IAAI;gBACd,GAAG,OAAO;aACX,CAAC,CAAC;YACH,IACE,UAAU;gBACV,QAAQ;gBACR,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,mBAAS,EAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,EAC5D;gBACA,OAAO,EAAE,EAAE,EAAE,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;aACzE;YACD,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,4EAA4E;QAC5E,yBAAyB;QACzB,KAAK,CAAC,cAAc;YAClB,KAAK,IAAI,IAAI,IAAI,IAAA,mBAAQ,EAAC,IAAI,EAAE;gBAC9B,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,KAAK;aACnB,CAAC,EAAE;gBACF,IAAI,CAAC,QAAQ,CAAC;oBACZ,IAAI,EAAE,OAAO;oBACb,QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;iBACvC,CAAC,CAAC;aACJ;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AA1CD,6BA0CC","sourcesContent":["import walkSync from 'walk-sync';\nimport type { Plugin } from 'rollup';\nimport { readFileSync } from 'fs';\nimport { dirname, join, resolve } from 'path';\nimport minimatch from 'minimatch';\n\nexport default function keepAssets({\n from,\n include,\n}: {\n from: string;\n include: string[];\n}): Plugin {\n return {\n name: 'copy-assets',\n\n // imports of assets should be left alone in the source code. This can cover\n // the case of .css as defined in the embroider v2 addon spec.\n async resolveId(source, importer, options) {\n const resolution = await this.resolve(source, importer, {\n skipSelf: true,\n ...options,\n });\n if (\n resolution &&\n importer &&\n include.some((pattern) => minimatch(resolution.id, pattern))\n ) {\n return { id: resolve(dirname(importer), source), external: 'relative' };\n }\n return resolution;\n },\n\n // the assets go into the output directory in the same relative locations as\n // in the input directory\n async generateBundle() {\n for (let name of walkSync(from, {\n globs: include,\n directories: false,\n })) {\n this.emitFile({\n type: 'asset',\n fileName: name,\n source: readFileSync(join(from, name)),\n });\n }\n },\n };\n}\n"]}
|