Skip to content

Commit

Permalink
webpack: Deprecate redundant allowRuntime option (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed Jun 23, 2021
1 parent 884cb27 commit a1c79fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-berries-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vanilla-extract/webpack-plugin': patch
---

Deprecate redundant `allowRuntime` option
11 changes: 8 additions & 3 deletions packages/webpack-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ interface PluginOptions {
test?: RuleSetRule['test'];
outputCss?: boolean;
externals?: any;
/** @deprecated */
allowRuntime?: boolean;
}
export class VanillaExtractPlugin {
Expand All @@ -71,12 +72,16 @@ export class VanillaExtractPlugin {
test = cssFileFilter,
outputCss = true,
externals,
allowRuntime = false,
allowRuntime,
} = options;

if (allowRuntime !== undefined) {
console.warn('The "allowRuntime" option is deprecated.');
}

this.test = test;
this.outputCss = outputCss;
this.allowRuntime = allowRuntime;
this.allowRuntime = allowRuntime ?? false;
this.childCompiler = new ChildCompiler(externals);
}

Expand Down Expand Up @@ -113,7 +118,7 @@ export class VanillaExtractPlugin {
}

let errorMessage = chalk.red(
`VanillaExtractPlugin: Styles detected outside of '.css.(ts/js)' files. You probably don't want this as these styles can't be statically extracted. If this is the desired behaviour, set 'allowRuntime: true'.`,
`VanillaExtractPlugin: Styles detected outside of '.css.(ts/js)' files. These styles cannot be statically extracted.`,
);

if (dependentResources.size > 0) {
Expand Down

0 comments on commit a1c79fc

Please sign in to comment.