diff --git a/.changeset/slow-plums-bake.md b/.changeset/slow-plums-bake.md new file mode 100644 index 00000000..d2c64e13 --- /dev/null +++ b/.changeset/slow-plums-bake.md @@ -0,0 +1,5 @@ +--- +'playroom': patch +--- + +Restrict `playroom`'s Vanilla Extract plugin to only process playroom's `.css.ts` files diff --git a/lib/makeWebpackConfig.js b/lib/makeWebpackConfig.js index 0179abe9..3051fbf9 100644 --- a/lib/makeWebpackConfig.js +++ b/lib/makeWebpackConfig.js @@ -180,7 +180,15 @@ module.exports = async (playroomConfig, options) => { filename: 'preview/index.html', publicPath: '../', }), - new VanillaExtractPlugin(), + new VanillaExtractPlugin({ + test: (filePath) => { + // Only apply VanillaExtract plugin to playroom's source `.css.ts` files + return ( + /\.css\.ts$/i.test(filePath) && + includePaths.some((includePath) => filePath.startsWith(includePath)) + ); + }, + }), new MiniCssExtractPlugin({ ignoreOrder: true }), ...(options.production ? [] : [new FriendlyErrorsWebpackPlugin()]), // If using a version of React earlier than 18, ignore the