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

fix(demos): Re-enable JS source maps #2124

Merged
merged 2 commits into from
Jan 29, 2018
Merged
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
14 changes: 8 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ const WRAP_CSS_IN_JS = process.env.MDC_WRAP_CSS_IN_JS === 'true' && IS_DEV;
const GENERATE_SOURCE_MAPS =
process.env.MDC_GENERATE_SOURCE_MAPS === 'true' ||
(process.env.MDC_GENERATE_SOURCE_MAPS !== 'false' && IS_DEV && WRAP_CSS_IN_JS);
const DEVTOOL = GENERATE_SOURCE_MAPS ? 'source-map' : false;
const BUILD_STATIC_DEMO_ASSETS = process.env.MDC_BUILD_STATIC_DEMO_ASSETS === 'true';

const SASS_DEVTOOL = GENERATE_SOURCE_MAPS ? 'source-map' : false;
const JS_DEVTOOL = 'source-map';

const banner = [
'/*!',
' Material Components for the web',
Expand Down Expand Up @@ -160,7 +162,7 @@ module.exports = [{
devServer: {
disableHostCheck: true,
},
devtool: DEVTOOL,
devtool: JS_DEVTOOL,
module: {
rules: [{
test: /\.js$/,
Expand Down Expand Up @@ -208,7 +210,7 @@ if (!IS_DEV) {
libraryTarget: 'umd',
library: ['mdc', '[name]'],
},
devtool: DEVTOOL,
devtool: JS_DEVTOOL,
module: {
rules: [{
test: /\.js$/,
Expand Down Expand Up @@ -258,7 +260,7 @@ if (!IS_DEV) {
publicPath: DEMO_ASSET_DIR_REL,
filename: CSS_JS_FILENAME_OUTPUT_PATTERN,
},
devtool: DEVTOOL,
devtool: SASS_DEVTOOL,
module: {
rules: [{
test: /\.scss$/,
Expand Down Expand Up @@ -297,7 +299,7 @@ if (IS_DEV) {
publicPath: DEMO_ASSET_DIR_REL,
filename: CSS_JS_FILENAME_OUTPUT_PATTERN,
},
devtool: DEVTOOL,
devtool: SASS_DEVTOOL,
module: {
rules: [{
test: /\.scss$/,
Expand All @@ -324,7 +326,7 @@ if (IS_DEV) {
libraryTarget: 'umd',
library: ['demo', '[name]'],
},
devtool: DEVTOOL,
devtool: JS_DEVTOOL,
module: {
rules: [{
test: /\.js$/,
Expand Down