How to use the webpack.SourceMapDevToolPlugin function in webpack

To help you get started, we’ve selected a few webpack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FormidableLabs / ecology / webpack.config.js View on Github external
}
    ]
  },
  plugins: [
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    }),
    new webpack.DefinePlugin({
      // Signal production, so that webpack removes non-production code that
      // is in condtionals like: `if (process.env.NODE_ENV === "production")`
      "process.env.NODE_ENV": JSON.stringify("production")
    }),
    new webpack.SourceMapDevToolPlugin("[file].map")
  ]
};
github alibaba / ice / react-materials / scaffolds / ice-opensource-site / gulpfile.js View on Github external
gulp.task('webpack-dev-server', () => {
  // modify some webpack config options
  const myConfig = Object.create(webpackConfig);
  myConfig.plugins.push(new webpack.SourceMapDevToolPlugin({}));
  // Start a webpack-dev-server
  new WebpackDevServer(webpack(myConfig), {
    publicPath: `http://127.0.0.1:${port}/build/`,
    stats: {
      colors: true,
    },
  }).listen(port, '127.0.0.1', (err) => {
    if (err) throw new gutil.PluginError('webpack-dev-server', err);
    opn(`http://127.0.0.1:${port}/`);
    gutil.log('[webpack-dev-server]', `http://127.0.0.1:${port}/webpack-dev-server/index.html`);
  });
});
github FormidableLabs / formidable-react-component-boilerplate / webpack.config.js View on Github external
}
    ]
  },
  plugins: [
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    }),
    new webpack.DefinePlugin({
      // Signal production, so that webpack removes non-production code that
      // is in condtionals like: `if (process.env.NODE_ENV === "production")`
      "process.env.NODE_ENV": JSON.stringify("production")
    }),
    new webpack.SourceMapDevToolPlugin("[file].map")
  ]
};
github FormidableLabs / victory-tree / webpack.config.js View on Github external
}
    ]
  },
  plugins: [
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    }),
    new webpack.DefinePlugin({
      // Signal production, so that webpack removes non-production code that
      // is in condtionals like: `if (process.env.NODE_ENV === "production")`
      "process.env.NODE_ENV": JSON.stringify("production")
    }),
    new webpack.SourceMapDevToolPlugin("[file].map")
  ]
};
github syntaxhighlighter / syntaxhighlighter / build / bundle.js View on Github external
'xregexp': 'xregexp/src/xregexp',
      },
    },
    module: {
      loaders: [
        {
          test: [/\.js$/, /\.es6$/],
          loader: 'babel',
        },
      ],
    },
    plugins: [
      new webpack.optimize.DedupePlugin(),
      new webpack.optimize.UglifyJsPlugin({ comments: false }),
      new webpack.BannerPlugin(banner),
      new webpack.SourceMapDevToolPlugin({
        filename: 'syntaxhighlighter.js.map',
        append: '\n//# sourceMappingURL=[url]',
      }),
    ]
  };

  return fs.promise.rename(corePath, backupCorePath)
    .then(() => fs.promise.writeFile(corePath, core))
    .then(() => webpack.promise(config))
    .then(stats =>
      fs.promise.unlink(corePath)
        .then(() => fs.promise.rename(backupCorePath, corePath))
        .then(() => stats)
    );
}
github Alorel / ngforage / webpack.config.js View on Github external
})
      );
    }
    
    if ([MODE.TEST, MODE.DEMO_JIT, MODE.DEMO_AOT].includes(this.mode)) {
      out.push(
        new webpack.ContextReplacementPlugin(
          /angular[\/\\]core/,
          path.join(__dirname, 'src')
        )
      );
    }
    
    if (this.mode === MODE.TEST) {
      out.push(
        new webpack.SourceMapDevToolPlugin({
                                             filename: null,
                                             test:     /\.(ts|js)($|\?)/i
                                           })
      );
      
      out.push(new webpack.NoEmitOnErrorsPlugin());
    }
    
    return out;
  }
github bleenco / bterm / webpack.config.js View on Github external
function getDevelopmentConfig() {
  return {
    module: {
      rules: [
        { enforce: 'pre', test: /\.js$/, loader: 'source-map-loader', exclude: [ root('node_modules') ] }
      ]
    },
    plugins: [
      new webpack.SourceMapDevToolPlugin({
        filename: '[file].map[query]',
        moduleFilenameTemplate: '[resource-path]',
        fallbackModuleFilenameTemplate: '[resource-path]?[hash]',
        sourceRoot: 'webpack:///'
      }),
      new webpack.NoEmitOnErrorsPlugin(),
      new webpack.NamedModulesPlugin(),
      new webpack.optimize.CommonsChunkPlugin({
        minChunks: Infinity,
        name: 'inline'
      }),
      new webpack.optimize.CommonsChunkPlugin({
        name: 'vendor',
        chunks: ['app'],
        minChunks: module => {
          return module.resource && module.resource.startsWith(nodeModules)
github openmrs / openmrs-module-coreapps / webpack.config.js View on Github external
use: {
					loader: 'url-loader',
					query: {
						limit: 10000
					}
				}
			}
		]
	},
	resolve: {
		modules: [path.resolve(__dirname, "node_modules")]
	}
};

if (env === 'dev') {
	config.plugins.push(new webpack.SourceMapDevToolPlugin({
      exclude: ["coreapps.vendor.js"]
    }));
} else if (env === 'prod') {
	config.devtool = 'source-map';
	
	config.plugins.push(new webpack.optimize.UglifyJsPlugin({
		sourceMap: true,
		compress: {
			warnings: false
		}
	}));
}

module.exports = config;