Skip to content

Allow StyleSheetServer to be minified out in client-only bundles, and StyleSheetTestUtils to be minified out in production#305

Merged
lencioni merged 2 commits into
masterfrom
server-test-minification
Mar 15, 2018
Merged

Allow StyleSheetServer to be minified out in client-only bundles, and StyleSheetTestUtils to be minified out in production#305
lencioni merged 2 commits into
masterfrom
server-test-minification

Conversation

@lencioni
Copy link
Copy Markdown
Collaborator

@lencioni lencioni commented Mar 4, 2018

Allow StyleSheetServer to be minified out in client-only bundles

Webpack can be configured to minify out this code when building bundles
that are client-only. This can be accomplished via the DefinePlugin:

new webpack.DefinePlugin({
  "typeof window": JSON.stringify("object")
})

Allow StyleSheetTestUtils to be minified out in production

These should never be used in production, so let's write it in a way
that it can be minified out to further reduce bundle sizes. Not a huge
impact, but might as well squeeze out a few more bytes.

lencioni added 2 commits March 3, 2018 16:43
These should never be used in production, so let's write it in a way
that it can be minified out to further reduce bundle sizes. Not a huge
impact, but might as well squeeze out a few more bytes.
Webpack can be configured to minify out this code when building bundles
that are client-only. This can be accomplished via the DefinePlugin:

```
new webpack.DefinePlugin({
  "typeof window": JSON.stringify("object")
})
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant