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

Generate Source Map with sourcesContent #52

Open
ChrisMio opened this issue Apr 24, 2018 · 1 comment
Open

Generate Source Map with sourcesContent #52

ChrisMio opened this issue Apr 24, 2018 · 1 comment

Comments

@ChrisMio
Copy link

ChrisMio commented Apr 24, 2018

Hi,
in my case the sources of the concated files are outside the webroot. this causes that i can not follow the source file along in chrome when debugging. So afaik for this case, the source maps support the sourcesContent option (i found this https://stackoverflow.com/a/19803425)

currently i have

devtool: 'source-map'

and

new ConcatPlugin({
uglify: false,
sourceMap: true,
...

Can someone please give me a hint / what to do?
I am not shure how webpack-concat-plugin handles source map, so is it influences by devtools setting for other webpack source map plugins?

@rickardliljeberg
Copy link

rickardliljeberg commented Aug 6, 2018

I want the bundle.js and bundle.map to end up in /Scripts/app

My setup looks like this

new ConcatPlugin({
	uglify: true,
	sourceMap: true,
        outputPath: './',
	fileName: 'bundle.js',
	filesToConcat: [
		'block-ui/jquery.blockUI.js',
		'./Scripts/myCustomScript.js'
	],
	attributes: {
		async: false
	}
});

The result

I get the files correctly in /Scripts/app and the reason for this is because I have the following in my module exports

output: {
		path: path.join(__dirname, 'Scripts', 'app'),
		filename: '[name].bundle.min.js',
	},

However my bundle.js.map contains the following
{"version":3,"sources":["\\node_modules\\block-ui\\jquery.blockUI.js", "\\Scripts\\myCustomScript.js" ...

So when I load a page in chrome it tries to load the original js files like so
http://localhost:55555/Scripts/app//node_modules/block-ui/jquery.blockUI.js
and
http://localhost:55555/Scripts/app//Scripts/myCustomScript.js

Where it of course should have been
http://localhost:55555/node_modules/block-ui/jquery.blockUI.js
and
http://localhost:55555/Scripts/myCustomScript.js

I am unsure how to get it cooperate

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