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

Add ability to use source maps on js only #56

Open
kinkay716 opened this issue Jun 8, 2015 · 3 comments
Open

Add ability to use source maps on js only #56

kinkay716 opened this issue Jun 8, 2015 · 3 comments
Milestone

Comments

@kinkay716
Copy link

Im running into a double sourcemap issue since my gulp-sass has mappings for .scss -> .css and then the bundler has source maps from bundle -> .css. In the browser, you see many mappings for css. I would like to turn off mapping for css when bundling. the current options of 'maps' is a blanket on or off for both css and js.

@kinkay716 kinkay716 changed the title Add ability to use source maps on css only Add ability to use source maps on js only Jun 8, 2015
@chmontgomery
Copy link
Contributor

as a work around, can you simple create two separate bundles? One for your js and one for css?

bundle: {
  'main-js': {
    scripts: [
      './js/app.js'
    ],
    options: {
      // ...
    }
  },
  'main-css-no-maps': {
    styles: [
      './styles/legacy.css',
      './styles/main.scss'
    ],
    options: {
      maps: false // disable sourcemaps
    }
  }
}

@kinkay716
Copy link
Author

yes...but hesitant to do so. I'm working on a fairly large app and my bundle.config is already 1400+ lines. If that is the only way, I understand. I'm surprised nobody has brought this up before? This would seem to be a pretty common use case.

@chmontgomery
Copy link
Contributor

Any file that is 1400+ lines long is going to be impossible to manage... my first suggestion would be to refactor your bundle.config so that each bundle is in it's own file and then the main bundle.config can require or loop through and include the separate files. You can also use a default set of options and merge them with custom ones for each bundle using something like _. defaults. Refactoring is your friend.

That problem aside, I'm not opposed to calling out the maps flag for scripts and styles separately. We already do that for many other options. It would look something like this:

'my-bundle': {
  // ...
  options: {
    maps: {
      scripts: true,
      styles: false
    }
  }
}

I would love a PR. Otherwise, I can't guarantee when this would get added...

@chmontgomery chmontgomery added this to the Ice Box milestone Jun 8, 2015
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