Skip to content

Commit

Permalink
fix(demos): Re-enable JS source maps (#2124)
Browse files Browse the repository at this point in the history
  • Loading branch information
acdvorak authored Jan 29, 2018
1 parent d461374 commit 929eb8c
Showing 1 changed file with 8 additions and 6 deletions.
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

0 comments on commit 929eb8c

Please sign in to comment.