Skip to content

Commit

Permalink
Add sideEffects to the package json for webpack 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik committed Mar 1, 2018
1 parent 38ab65b commit 309d31a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 0 additions & 2 deletions __tests__/testIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
import * as commonjsIcons from '../package/index'
import * as es2015Icons from '../package/index.es'

console.log('hi')

describe('the generated commonjs module', () => {
it('should export icons that render to SVGs', () => {
for (const iconName of Object.keys(commonjsIcons)) {
Expand Down
8 changes: 8 additions & 0 deletions __tests__/testPackage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-env jest */

describe('the npm package', () => {
it('should set sideEffects to false to allow webpack to optimize re-exports', () => {
const packageJson = require('../package/package.json')
expect(packageJson.sideEffects).toBe(false)
})
})
1 change: 1 addition & 0 deletions generate-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ fse.writeFileSync(path.join(__dirname, 'package', 'package.json'), JSON.stringif
'main',
'module',
'jsnext:main',
'sideEffects',
'repository',
'keywords',
'author',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "./index.js",
"module": "./index.es.js",
"jsnext:main": "./index.es.js",
"sideEffects": false,
"repository": {
"type": "git",
"url": "git+https://github.com/TeamWertarbyte/mdi-material-ui.git"
Expand Down

0 comments on commit 309d31a

Please sign in to comment.