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

Issue when enabling sourceMap option #1

Closed
bigtimebuddy opened this issue Jun 19, 2017 · 7 comments
Closed

Issue when enabling sourceMap option #1

bigtimebuddy opened this issue Jun 19, 2017 · 7 comments

Comments

@bigtimebuddy
Copy link

Hello, would love to utilize this plugin, but does does not seem to play well with Rollup's sourceMap option. Here's a simple example. It does not retain any of the sources or mappings.

rollup.config.js

import preprocess from 'rollup-plugin-preprocess';

export default {
    entry: 'src/index.js',
    dest: 'bundle.js',
    format: 'cjs',
    sourceMap: true,
    plugins: [
        preprocess({
            context: {
                DEBUG: true
            }
        })
    ]
};

bundle.js.map

{"version":3,"file":"bundle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

@Katochimoto
Copy link
Owner

Hello. Wow, I will try to solve. Thanks!

@bigtimebuddy
Copy link
Author

I appreciate it, thanks!

@Katochimoto
Copy link
Owner

Preprocess doesn't support Source Maps.
jsoverson/preprocess#59
A good option to make a support there. But I haven't free time yet.

Here I changed the load method.
SourceMap will be built on the modified code.
Not a very good option, but...
#2

@Katochimoto
Copy link
Owner

https://github.com/Katochimoto/rollup-plugin-preprocess/releases/tag/0.0.2
Waiting for Source Maps on Preprocess.

@bigtimebuddy
Copy link
Author

@Katochimoto It seems the latest published version on NPM is missing the main file:
rollup-plugin-preprocess.js

@Katochimoto
Copy link
Owner

@bigtimebuddy
Copy link
Author

No worries, I've definitely done that myself numerous times! Thanks for your help on this.

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

No branches or pull requests

2 participants