mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-11 18:19:58 +00:00
Remove source maps from production builds
This commit is contained in:
@@ -69,7 +69,7 @@ const webpackConfig = require(`${ROOT}/webpack.config.js`)({
|
|||||||
// Add mode to config
|
// Add mode to config
|
||||||
webpackConfig.mode = argv.mode;
|
webpackConfig.mode = argv.mode;
|
||||||
webpackConfig.devtool = argv.mode === "production"
|
webpackConfig.devtool = argv.mode === "production"
|
||||||
? "source-map"
|
? "none"
|
||||||
: "eval";
|
: "eval";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ const path = require("path");
|
|||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||||
|
|
||||||
|
|
||||||
|
const sourceFileExtensions = [
|
||||||
|
".js", ".jsx"
|
||||||
|
, ".ts", ".tsx"
|
||||||
|
];
|
||||||
|
|
||||||
module.exports = (env) => ({
|
module.exports = (env) => ({
|
||||||
entry: {
|
entry: {
|
||||||
"main": `${env.includePath}/main.ts`
|
"main": `${env.includePath}/main.ts`
|
||||||
@@ -41,8 +47,7 @@ module.exports = (env) => ({
|
|||||||
{
|
{
|
||||||
from: env.includePath
|
from: env.includePath
|
||||||
, to: env.outputPath
|
, to: env.outputPath
|
||||||
, ignore: [ "*.js", "*.jsx"
|
, ignore: sourceFileExtensions.map(ext => `*${ext}`)
|
||||||
, "*.ts", "*.tsx" ]
|
|
||||||
, transform (content, path) {
|
, transform (content, path) {
|
||||||
// Access to variables in static files
|
// Access to variables in static files
|
||||||
if (path.endsWith(".json")) {
|
if (path.endsWith(".json")) {
|
||||||
@@ -73,8 +78,7 @@ module.exports = (env) => ({
|
|||||||
{
|
{
|
||||||
test: /\.(js|ts)x?$/
|
test: /\.(js|ts)x?$/
|
||||||
, resolve: {
|
, resolve: {
|
||||||
extensions: [ ".js", ".jsx"
|
extensions: sourceFileExtensions
|
||||||
, ".ts", ".tsx" ]
|
|
||||||
}
|
}
|
||||||
, include: env.includePath
|
, include: env.includePath
|
||||||
, use: {
|
, use: {
|
||||||
|
|||||||
Reference in New Issue
Block a user