@ms-cloudpack/bundler-rollup 0.3.7 → 0.3.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"getRollupPlugins.d.ts","sourceRoot":"","sources":["../src/getRollupPlugins.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqBrC,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA4FpB"}
1
+ {"version":3,"file":"getRollupPlugins.d.ts","sourceRoot":"","sources":["../src/getRollupPlugins.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqBrC,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA4FpB"}
@@ -4,17 +4,18 @@ import json from './plugins/json/index.js';
4
4
  import { nodeResolve } from '@rollup/plugin-node-resolve';
5
5
  import _replace from '@rollup/plugin-replace';
6
6
  import _terser from '@rollup/plugin-terser';
7
+ import _commonjs from '@rollup/plugin-commonjs';
7
8
  import _nodePolyfills from 'rollup-plugin-polyfill-node';
8
9
  import _postcss from 'rollup-plugin-postcss';
9
- import commonjs from './plugins/commonjs/index.js';
10
10
  import { normalizeRequireStatements } from './plugins/normalizeRequireStatements.js';
11
- import { importAsString } from './plugins/importAsString.js';
11
+ import { importAsString } from 'rollup-plugin-string-import';
12
12
  // Workaround for https://github.com/microsoft/TypeScript/issues/49189#issuecomment-1137756847
13
13
  // (https://arethetypeswrong.github.io/?p=%40rollup%2Fplugin-replace%405.0.2)
14
14
  // At runtime, we should always be using the ESM version of these packages, which use `export default`.
15
15
  // However, typescript interprets the types as CJS modules with a `default` property (which will fail at runtime).
16
16
  const replace = _replace;
17
17
  const terser = _terser;
18
+ const commonjs = _commonjs;
18
19
  const nodePolyfills = _nodePolyfills;
19
20
  const postcss = _postcss;
20
21
  const dynamicImportVariables = _dynamicImportVariables;
@@ -1 +1 @@
1
- {"version":3,"file":"getRollupPlugins.js","sourceRoot":"","sources":["../src/getRollupPlugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAE9C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,QAAQ,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,8FAA8F;AAC9F,6EAA6E;AAC7E,uGAAuG;AACvG,kHAAkH;AAClH,MAAM,OAAO,GAAG,QAA8C,CAAC;AAC/D,MAAM,MAAM,GA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AAC;KACH,CAAC,MAAM,CAAC,CAAC,MAAM,EAAoB,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { getSwcConfig } from '@ms-cloudpack/bundler-utilities';\nimport _dynamicImportVariables from '@rollup/plugin-dynamic-import-vars';\nimport json from './plugins/json/index.js';\nimport { nodeResolve } from '@rollup/plugin-node-resolve';\nimport _replace from '@rollup/plugin-replace';\nimport type _swc from '@rollup/plugin-swc';\nimport _terser from '@rollup/plugin-terser';\nimport type { Plugin } from 'rollup';\nimport _nodePolyfills from 'rollup-plugin-polyfill-node';\nimport _postcss from 'rollup-plugin-postcss';\nimport commonjs from './plugins/commonjs/index.js';\nimport { normalizeRequireStatements } from './plugins/normalizeRequireStatements.js';\nimport { importAsString } from './plugins/importAsString.js';\n\n// Workaround for https://github.com/microsoft/TypeScript/issues/49189#issuecomment-1137756847\n// (https://arethetypeswrong.github.io/?p=%40rollup%2Fplugin-replace%405.0.2)\n// At runtime, we should always be using the ESM version of these packages, which use `export default`.\n// However, typescript interprets the types as CJS modules with a `default` property (which will fail at runtime).\nconst replace = _replace as unknown as typeof _replace.default;\nconst terser = _terser as unknown as typeof _terser.default;\nconst nodePolyfills = _nodePolyfills as unknown as typeof _nodePolyfills.default;\nconst postcss = _postcss as unknown as typeof _postcss.default;\nconst dynamicImportVariables = _dynamicImportVariables as unknown as typeof _dynamicImportVariables.default;\n\nfunction getSwcPlugin() {\n return import('@rollup/plugin-swc').then((m) => m.default) as Promise<typeof _swc.default>;\n}\n\nexport async function getRollupPlugins(options: {\n isProduction?: boolean;\n packagePath: string;\n enableTypescript?: boolean;\n dynamicImports?: string[];\n sourcemap: boolean | undefined;\n resolveWebExtensions: boolean;\n}): Promise<Plugin[]> {\n const { isProduction, packagePath, enableTypescript, dynamicImports = [], sourcemap, resolveWebExtensions } = options;\n\n const swcConfigsForTs = enableTypescript ? getSwcConfig({ packagePath, sourcemap }) : undefined;\n\n return [\n // Used to replaces constants in the code.\n replace({\n values: {\n 'process.env.NODE_ENV': isProduction ? `\"production\"` : `\"development\"`,\n DEPRECATED_UNIT_TEST: 'true',\n },\n preventAssignment: true,\n }),\n\n normalizeRequireStatements(),\n\n postcss({\n modules: {\n globalModulePaths: [/global\\.css$/],\n },\n }),\n\n // Used to parse commonjs.\n commonjs({\n // Treat all dependencies as external esm modules (since we'll be bundling them.)\n esmExternals: true,\n\n // When __esModule is true, the default export is `exports.default`; otherwise it's `module.exports`.\n defaultIsModuleExports: true,\n\n // Convert `require('library')` to `import * as library from 'library'` always, because `import library from\n // 'library' risks runtime failure if the dependency is ESM that doesn't export a default.\n requireReturnsDefault: false,\n }),\n\n // Used to compile json files into javascript exports.\n json({\n extensions: ['.json', '.resjson'],\n }),\n\n // // Used to resolve node_modules.\n nodeResolve({\n preferBuiltins: false,\n browser: true,\n // TODO: Align with other bundlers https://github.com/microsoft/cloudpack/issues/2687\n extensions: [\n ...(resolveWebExtensions ? ['.web.js'] : []),\n '.js',\n '.json',\n ...(enableTypescript && resolveWebExtensions ? ['.web.ts', '.web.tsx'] : []),\n ...(enableTypescript ? ['.ts', '.tsx'] : []),\n ],\n }),\n\n // Used to browserify node globals (process, global, etc.)\n nodePolyfills(),\n\n // The rollup swc plugin gets confused by angle bracket casts like `const x = <T>value;`\n // in .ts files if the tsx option is enabled, so use separate rules for .ts and .tsx files.\n // https://github.com/microsoft/cloudpack/pull/2555\n swcConfigsForTs &&\n (await getSwcPlugin())({\n swc: swcConfigsForTs.tsOnly,\n include: /\\.ts$/,\n }),\n\n swcConfigsForTs &&\n (await getSwcPlugin())({\n swc: swcConfigsForTs.tsx,\n include: /\\.tsx$/,\n }),\n\n // Only run this plugin on **/*.dynamic.* files (plus others as specified) to avoid an extra\n // parsing/processing step on all files.\n // Must be done AFTER the TS step because it can only handle JS syntax.\n dynamicImportVariables({\n include: [\n '**/*.dynamic.*',\n // Convert the dynamic imports options to globs starting with **\n // (the plugin seems to be matching against full paths)\n ...dynamicImports.map((d) => (d.startsWith('**/') ? d : d.replace(/^(\\.?\\/)?/, '**/'))),\n ],\n }),\n\n // Minify production builds as a last step.\n !!isProduction && terser(),\n\n importAsString({\n include: '**/*.glsl',\n }),\n ].filter((plugin): plugin is Plugin => !!plugin);\n}\n"]}
1
+ {"version":3,"file":"getRollupPlugins.js","sourceRoot":"","sources":["../src/getRollupPlugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,IAAI,MAAM,yBAAyB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAE9C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,OAAO,cAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,8FAA8F;AAC9F,6EAA6E;AAC7E,uGAAuG;AACvG,kHAAkH;AAClH,MAAM,OAAO,GAAG,QAA8C,CAAC;AAC/D,MAAM,MAAM,GAAG,OAA4C,CAAC;AAC5D,MAAM,QAAQ,GAAG,SAAgD,CAAC;AAClE,MAAM,aAAa,GAAG,cAA0D,CAAC;AACjF,MAAM,OAAO,GAAG,QAA8C,CAAC;AAC/D,MAAM,sBAAsB,GAAG,uBAA4E,CAAC;AAE5G,SAAS,YAAY;IACnB,OAAO,MAAM,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAiC,CAAC;AAC7F,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAOtC;IAC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,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAC7C;SACF,CAAC;QAEF,0DAA0D;QAC1D,aAAa,EAAE;QAEf,wFAAwF;QACxF,2FAA2F;QAC3F,mDAAmD;QACnD,eAAe;YACb,CAAC,MAAM,YAAY,EAAE,CAAC,CAAC;gBACrB,GAAG,EAAE,eAAe,CAAC,MAAM;gBAC3B,OAAO,EAAE,OAAO;aACjB,CAAC;QAEJ,eAAe;YACb,CAAC,MAAM,YAAY,EAAE,CAAC,CAAC;gBACrB,GAAG,EAAE,eAAe,CAAC,GAAG;gBACxB,OAAO,EAAE,QAAQ;aAClB,CAAC;QAEJ,4FAA4F;QAC5F,wCAAwC;QACxC,uEAAuE;QACvE,sBAAsB,CAAC;YACrB,OAAO,EAAE;gBACP,gBAAgB;gBAChB,gEAAgE;gBAChE,uDAAuD;gBACvD,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;aACxF;SACF,CAAC;QAEF,2CAA2C;QAC3C,CAAC,CAAC,YAAY,IAAI,MAAM,EAAE;QAE1B,cAAc,CAAC;YACb,OAAO,EAAE,WAAW;SACrB,CAAC;KACH,CAAC,MAAM,CAAC,CAAC,MAAM,EAAoB,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { getSwcConfig } from '@ms-cloudpack/bundler-utilities';\nimport _dynamicImportVariables from '@rollup/plugin-dynamic-import-vars';\nimport json from './plugins/json/index.js';\nimport { nodeResolve } from '@rollup/plugin-node-resolve';\nimport _replace from '@rollup/plugin-replace';\nimport type _swc from '@rollup/plugin-swc';\nimport _terser from '@rollup/plugin-terser';\nimport _commonjs from '@rollup/plugin-commonjs';\nimport type { Plugin } from 'rollup';\nimport _nodePolyfills from 'rollup-plugin-polyfill-node';\nimport _postcss from 'rollup-plugin-postcss';\nimport { normalizeRequireStatements } from './plugins/normalizeRequireStatements.js';\nimport { importAsString } from 'rollup-plugin-string-import';\n\n// Workaround for https://github.com/microsoft/TypeScript/issues/49189#issuecomment-1137756847\n// (https://arethetypeswrong.github.io/?p=%40rollup%2Fplugin-replace%405.0.2)\n// At runtime, we should always be using the ESM version of these packages, which use `export default`.\n// However, typescript interprets the types as CJS modules with a `default` property (which will fail at runtime).\nconst replace = _replace as unknown as typeof _replace.default;\nconst terser = _terser as unknown as typeof _terser.default;\nconst commonjs = _commonjs as unknown as typeof _commonjs.default;\nconst nodePolyfills = _nodePolyfills as unknown as typeof _nodePolyfills.default;\nconst postcss = _postcss as unknown as typeof _postcss.default;\nconst dynamicImportVariables = _dynamicImportVariables as unknown as typeof _dynamicImportVariables.default;\n\nfunction getSwcPlugin() {\n return import('@rollup/plugin-swc').then((m) => m.default) as Promise<typeof _swc.default>;\n}\n\nexport async function getRollupPlugins(options: {\n isProduction?: boolean;\n packagePath: string;\n enableTypescript?: boolean;\n dynamicImports?: string[];\n sourcemap: boolean | undefined;\n resolveWebExtensions: boolean;\n}): Promise<Plugin[]> {\n const { isProduction, packagePath, enableTypescript, dynamicImports = [], sourcemap, resolveWebExtensions } = options;\n\n const swcConfigsForTs = enableTypescript ? getSwcConfig({ packagePath, sourcemap }) : undefined;\n\n return [\n // Used to replaces constants in the code.\n replace({\n values: {\n 'process.env.NODE_ENV': isProduction ? `\"production\"` : `\"development\"`,\n DEPRECATED_UNIT_TEST: 'true',\n },\n preventAssignment: true,\n }),\n\n normalizeRequireStatements(),\n\n postcss({\n modules: {\n globalModulePaths: [/global\\.css$/],\n },\n }),\n\n // Used to parse commonjs.\n commonjs({\n // Treat all dependencies as external esm modules (since we'll be bundling them.)\n esmExternals: true,\n\n // When __esModule is true, the default export is `exports.default`; otherwise it's `module.exports`.\n defaultIsModuleExports: true,\n\n // Convert `require('library')` to `import * as library from 'library'` always, because `import library from\n // 'library' risks runtime failure if the dependency is ESM that doesn't export a default.\n requireReturnsDefault: false,\n }),\n\n // Used to compile json files into javascript exports.\n json({\n extensions: ['.json', '.resjson'],\n }),\n\n // // Used to resolve node_modules.\n nodeResolve({\n preferBuiltins: false,\n browser: true,\n // TODO: Align with other bundlers https://github.com/microsoft/cloudpack/issues/2687\n extensions: [\n ...(resolveWebExtensions ? ['.web.js'] : []),\n '.js',\n '.json',\n ...(enableTypescript && resolveWebExtensions ? ['.web.ts', '.web.tsx'] : []),\n ...(enableTypescript ? ['.ts', '.tsx'] : []),\n ],\n }),\n\n // Used to browserify node globals (process, global, etc.)\n nodePolyfills(),\n\n // The rollup swc plugin gets confused by angle bracket casts like `const x = <T>value;`\n // in .ts files if the tsx option is enabled, so use separate rules for .ts and .tsx files.\n // https://github.com/microsoft/cloudpack/pull/2555\n swcConfigsForTs &&\n (await getSwcPlugin())({\n swc: swcConfigsForTs.tsOnly,\n include: /\\.ts$/,\n }),\n\n swcConfigsForTs &&\n (await getSwcPlugin())({\n swc: swcConfigsForTs.tsx,\n include: /\\.tsx$/,\n }),\n\n // Only run this plugin on **/*.dynamic.* files (plus others as specified) to avoid an extra\n // parsing/processing step on all files.\n // Must be done AFTER the TS step because it can only handle JS syntax.\n dynamicImportVariables({\n include: [\n '**/*.dynamic.*',\n // Convert the dynamic imports options to globs starting with **\n // (the plugin seems to be matching against full paths)\n ...dynamicImports.map((d) => (d.startsWith('**/') ? d : d.replace(/^(\\.?\\/)?/, '**/'))),\n ],\n }),\n\n // Minify production builds as a last step.\n !!isProduction && terser(),\n\n importAsString({\n include: '**/*.glsl',\n }),\n ].filter((plugin): plugin is Plugin => !!plugin);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundler-rollup",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "A cloudpack plugin for abstracting rollup.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,6 +26,7 @@
26
26
  "@ms-cloudpack/package-utilities": "^12.3.10",
27
27
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
28
28
  "@ms-cloudpack/path-utilities": "^3.1.5",
29
+ "@rollup/plugin-commonjs": "^28.0.4",
29
30
  "@rollup/plugin-dynamic-import-vars": "^2.0.0",
30
31
  "@rollup/plugin-node-resolve": "^16.0.0",
31
32
  "@rollup/plugin-replace": "^6.0.0",
@@ -34,16 +35,12 @@
34
35
  "@rollup/plugin-url": "^8.0.0",
35
36
  "@rollup/pluginutils": "^5.0.1",
36
37
  "@swc/core": "^1.3.0",
37
- "commondir": "^1.0.1",
38
- "estree-walker": "^2.0.2",
39
- "fdir": "^6.2.0",
40
- "is-reference": "1.2.1",
41
38
  "magic-string": "^0.30.5",
42
- "picomatch": "^4.0.2",
43
39
  "postcss": "^8.0.0",
44
40
  "rollup": "^4.0.0",
45
41
  "rollup-plugin-polyfill-node": "^0.13.0",
46
42
  "rollup-plugin-postcss": "^4.0.0",
43
+ "rollup-plugin-string-import": "^1.2.6",
47
44
  "sass": "^1.0.0"
48
45
  },
49
46
  "devDependencies": {
@@ -1,14 +0,0 @@
1
- export { commonjs as default };
2
- declare function commonjs(options?: {}): {
3
- name: string;
4
- version: string;
5
- options(rawOptions: any): any;
6
- buildStart({ plugins }: {
7
- plugins: any;
8
- }): void;
9
- buildEnd(): void;
10
- load(id: any): any;
11
- shouldTransformCachedModule(...args: any[]): any;
12
- transform(code: any, id: any): any;
13
- };
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/commonjs/index.js"],"names":[],"mappings":";AAk7DA;;;;;;;;;;;EA0QC"}