@quilted/rollup 0.1.4 → 0.1.6
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/CHANGELOG.md +18 -0
- package/build/cjs/app.cjs +160 -142
- package/build/cjs/features/assets.cjs +130 -0
- package/build/cjs/features/css.cjs +71 -0
- package/build/cjs/{env.cjs → features/env.cjs} +4 -4
- package/build/cjs/{request-router.cjs → features/request-router.cjs} +3 -3
- package/build/cjs/{shared → features}/source-code.cjs +7 -2
- package/build/cjs/features/system-js.cjs +35 -0
- package/build/cjs/index.cjs +0 -7
- package/build/cjs/shared/rollup.cjs +0 -4
- package/build/esm/app.mjs +162 -144
- package/build/esm/features/assets.mjs +107 -0
- package/build/esm/features/css.mjs +69 -0
- package/build/esm/{env.mjs → features/env.mjs} +4 -4
- package/build/esm/{request-router.mjs → features/request-router.mjs} +3 -3
- package/build/esm/{shared → features}/source-code.mjs +6 -1
- package/build/esm/features/system-js.mjs +33 -0
- package/build/esm/index.mjs +1 -3
- package/build/esm/shared/rollup.mjs +1 -4
- package/build/esnext/app.esnext +162 -144
- package/build/esnext/features/assets.esnext +107 -0
- package/build/esnext/features/css.esnext +69 -0
- package/build/esnext/{env.esnext → features/env.esnext} +4 -4
- package/build/esnext/{request-router.esnext → features/request-router.esnext} +3 -3
- package/build/esnext/{shared → features}/source-code.esnext +6 -1
- package/build/esnext/features/system-js.esnext +33 -0
- package/build/esnext/index.esnext +1 -3
- package/build/esnext/shared/rollup.esnext +1 -4
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/app.d.ts +33 -144
- package/build/typescript/app.d.ts.map +1 -1
- package/build/typescript/features/assets.d.ts +13 -0
- package/build/typescript/features/assets.d.ts.map +1 -0
- package/build/typescript/features/css.d.ts +16 -0
- package/build/typescript/features/css.d.ts.map +1 -0
- package/build/typescript/features/env.d.ts +57 -0
- package/build/typescript/features/env.d.ts.map +1 -0
- package/build/typescript/features/graphql/transform.d.ts +17 -0
- package/build/typescript/features/graphql/transform.d.ts.map +1 -0
- package/build/typescript/features/graphql.d.ts +6 -0
- package/build/typescript/features/graphql.d.ts.map +1 -0
- package/build/typescript/features/request-router.d.ts +15 -0
- package/build/typescript/features/request-router.d.ts.map +1 -0
- package/build/typescript/features/source-code.d.ts +5 -0
- package/build/typescript/features/source-code.d.ts.map +1 -0
- package/build/typescript/features/system-js.d.ts +7 -0
- package/build/typescript/features/system-js.d.ts.map +1 -0
- package/build/typescript/index.d.ts +1 -3
- package/build/typescript/index.d.ts.map +1 -1
- package/package.json +5 -2
- package/source/app.ts +184 -122
- package/source/features/assets.ts +183 -0
- package/source/features/css.ts +91 -0
- package/source/{env.ts → features/env.ts} +4 -4
- package/source/{request-router.ts → features/request-router.ts} +3 -3
- package/source/{shared → features}/source-code.ts +3 -0
- package/source/features/system-js.ts +36 -0
- package/source/index.ts +0 -5
- /package/build/cjs/{graphql → features/graphql}/transform.cjs +0 -0
- /package/build/cjs/{graphql.cjs → features/graphql.cjs} +0 -0
- /package/build/esm/{graphql → features/graphql}/transform.mjs +0 -0
- /package/build/esm/{graphql.mjs → features/graphql.mjs} +0 -0
- /package/build/esnext/{graphql → features/graphql}/transform.esnext +0 -0
- /package/build/esnext/{graphql.esnext → features/graphql.esnext} +0 -0
- /package/source/{graphql → features/graphql}/transform.ts +0 -0
- /package/source/{graphql.ts → features/graphql.ts} +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {readFile} from 'fs/promises';
|
|
2
|
+
import {createRequire} from 'module';
|
|
3
|
+
|
|
4
|
+
import type {Plugin} from 'rollup';
|
|
5
|
+
|
|
6
|
+
export function systemJS({minify = false} = {}) {
|
|
7
|
+
return {
|
|
8
|
+
name: '@quilted/system-js',
|
|
9
|
+
async renderChunk(_, chunk, options) {
|
|
10
|
+
if (options.format !== 'system' || !chunk.isEntry) return null;
|
|
11
|
+
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const systemjs = minify
|
|
14
|
+
? require.resolve('systemjs/dist/s.min.js')
|
|
15
|
+
: require.resolve('systemjs/dist/s.js');
|
|
16
|
+
|
|
17
|
+
// We write the systemjs loader to a dedicated file, and we make it the
|
|
18
|
+
// "first import" of the chunk so that it is the first file listed in
|
|
19
|
+
// the manifest.
|
|
20
|
+
const fileHandle = this.emitFile({
|
|
21
|
+
type: 'asset',
|
|
22
|
+
name: 'loader.js',
|
|
23
|
+
source: (await readFile(systemjs, {encoding: 'utf8'})).replace(
|
|
24
|
+
// Remove the source map comment, if it is present, because we don’t upload the
|
|
25
|
+
// sourcemap for this file.
|
|
26
|
+
/\n?[/][/]# sourceMappingURL=s.*\.map\n?$/,
|
|
27
|
+
'',
|
|
28
|
+
),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
chunk.imports.unshift(this.getFileName(fileHandle));
|
|
32
|
+
|
|
33
|
+
return null;
|
|
34
|
+
},
|
|
35
|
+
} satisfies Plugin;
|
|
36
|
+
}
|
package/source/index.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
export {magicModuleEnv, type MagicModuleEnvOptions} from './env.ts';
|
|
2
1
|
export {
|
|
3
2
|
quiltAppBrowser,
|
|
4
3
|
quiltAppServer,
|
|
5
|
-
magicModuleAppComponent,
|
|
6
|
-
magicModuleAppBrowserEntry,
|
|
7
|
-
magicModuleAppRequestRouter,
|
|
8
4
|
type AppOptions,
|
|
9
5
|
type AppBrowserOptions,
|
|
10
6
|
type AppServerOptions,
|
|
11
7
|
} from './app.ts';
|
|
12
|
-
export {magicModuleRequestRouterEntry} from './request-router.ts';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|