diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 000000000..e297cd2a3 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,22 @@ +{ + "branches": ["master"], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "angular", + "releaseRules": [ + { "type": "chore", "release": "patch" }, + { "type": "refactor", "release": "patch" }, + { "type": "style", "release": "patch" }, + { "scope": "no-release", "release": false }, + { "scope": "cli", "release": "patch" }, + { "scope": "patch", "release": "patch" } + ] + } + ], + "@semantic-release/release-notes-generator", + "@semantic-release/npm", + "@semantic-release/github" + ] +} \ No newline at end of file diff --git a/src/cli.ts b/src/cli.ts index b1d124864..ad4093f6f 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -28,6 +28,7 @@ cli .option('--jsxFragment ', 'Name of JSX fragment function', { default: 'React.Fragment', }) + .option('--inlineDynamicImports', 'Create a single bundle that inlines dynamic imports') .action(async (files: string[], options) => { const { rollup, watch } = await import('rollup') const { createRollupConfigs, printSizes } = await import('./') @@ -43,7 +44,8 @@ cli outDir: options.outDir, define: options.define, external: options.external, - moduleName: options.moduleName + moduleName: options.moduleName, + inlineDynamicImports: options.inlineDynamicImports }) if (options.watch) { const watcher = watch( diff --git a/src/index.ts b/src/index.ts index a9deff468..75adf21fc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,6 +28,7 @@ type Options = { } /** Don't bundle these packages */ external?: string[] + inlineDynamicImports?: boolean } export async function createRollupConfigs(files: string[], options: Options) { @@ -40,6 +41,7 @@ export async function createRollupConfigs(files: string[], options: Options) { inputConfig: { input: files, preserveEntrySignatures: 'strict', + inlineDynamicImports: options.inlineDynamicImports, onwarn(warning, handler) { if ( warning.code === 'UNRESOLVED_IMPORT' ||