Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: disable source map using option #195

Closed
alexander-akait opened this issue Apr 7, 2017 · 7 comments
Closed

refactor: disable source map using option #195

alexander-akait opened this issue Apr 7, 2017 · 7 comments
Assignees

Comments

@alexander-akait
Copy link
Member

Is it possible to disable generation source map generation using options? This will speed up compilation on watch when i disable source map in webpack. It would be nice if this option was taken from the webpack config by default. If your accept i can do PR.

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Apr 7, 2017

@evilebottnawi Yep, right, could you check the #177, I intend to do that for v2.0.0 since it is technically a semver major, but wainting for other related loaders I need to update first style-loader/ extract-text-webpack-plugin

@alexander-akait
Copy link
Member Author

@michael-ciniawsky can i help you with this?

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Apr 7, 2017

@evilebottnawi Yep 😛 test if disabling sourcemaps works correctly

Sourcemap Implementation is here

v2.0.0 should work without css-loader and export a module directly (perf), but it is planned to export ES2015 Modules in the near future and style-loader/ extract-text-webpack-plugin don't support that yet. If you what to try that out you need to change this line to a CJS Export

- const module = `export default ${JSON.stringify(css)}`
+ const module = `module.exports = ${JSON.stringify(css)}`

webpack.config.js

const config = {
  module: {
    rules: [
      {
         test: /\.css$/,
         use: [ 'style-loader', 'postcss-loader' ]
      }
    ]
  }
}

Otherwise by using use: [ 'style-loader', 'css-loader', 'postcss-loader' ] you can skip that part, since postcss-loader will export a {String} as it is the current behaviour.

@michael-ciniawsky
Copy link
Member

npm i -D michael-ciniawsky/postcss-loader#v2

@michael-ciniawsky michael-ciniawsky changed the title Disable source map using option refactor: Disable source map using option Apr 18, 2017
@michael-ciniawsky michael-ciniawsky changed the title refactor: Disable source map using option refactor: disable source map using option Apr 24, 2017
@michael-ciniawsky michael-ciniawsky added this to the 1.4.0 milestone Apr 24, 2017
@alexander-akait
Copy link
Member Author

/cc @michael-ciniawsky let's do this, add options sourceMap as in css-loader?

@alexander-akait
Copy link
Member Author

/cc @michael-ciniawsky ping 😄

@michael-ciniawsky
Copy link
Member

Fixed by #191

@michael-ciniawsky michael-ciniawsky modified the milestones: 1.4.0, 2.0.0 May 2, 2017
@michael-ciniawsky michael-ciniawsky removed this from Refactor in Dashboard May 2, 2017
@michael-ciniawsky michael-ciniawsky modified the milestone: 3.0.0 May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants