Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ module.exports = {

### `style.sourceMaps`

Source maps are always generated for styles, but it is possible to disable it.
Source maps are never generated for styles, but it is possible to enable it.

```js
module.exports = {
style: {
sourceMaps: false
sourceMaps: true
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/webpack/loaders/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import actions from '../../actions'

const defaultOptions = {
cssModules: true,
sourceMaps: true,
sourceMaps: false,
extract: true
}

Expand Down
14 changes: 7 additions & 7 deletions src/webpack/loaders/style.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ describe('style', function () {
expect(config.module.loaders[1].loader.includes('css?modules')).to.eql(false)
})

it('should have source maps enabled by default', () => {
it('should have source maps disabled by default', () => {
const config = loader.configure({ projectPath })

expect(config.module.loaders[0].loader.includes('sourceMap')).to.eql(true)
expect(config.module.loaders[1].loader.includes('sourceMap')).to.eql(true)
expect(config.module.loaders[0].loader.includes('sourceMap')).to.eql(false)
expect(config.module.loaders[1].loader.includes('sourceMap')).to.eql(false)
})

it('should be possible to disable source maps', () => {
const config = loader.configure({ projectPath, style: { sourceMaps: false } })
it('should be possible to enable source maps', () => {
const config = loader.configure({ projectPath, style: { sourceMaps: true } })

expect(config.module.loaders[0].loader.includes('sourceMap')).to.eql(false)
expect(config.module.loaders[1].loader.includes('sourceMap')).to.eql(false)
expect(config.module.loaders[0].loader.includes('sourceMap')).to.eql(true)
expect(config.module.loaders[1].loader.includes('sourceMap')).to.eql(true)
})

describe('extract text webpack plugin', () => {
Expand Down