diff --git a/package.json b/package.json index 827a8da..de5300d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "1.13.1", "scripts": { "start-plugin": "wp-scripts start", - "plugin-build": "wp-scripts build", + "plugin-build": "NODE_ENV=development wp-scripts build", "linux:make-zip": "npm run plugin-build && zip -r logo_maker_plugin.zip index.php plugin_build && mv logo_maker_plugin.zip development/", "font:all": "npm run font:config && npm run font:download", "font:config": "node development/createFontConfigFile.js", diff --git a/webpack.config.js b/webpack.config.js index c58e2e7..96df293 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,9 +3,12 @@ const path = require("path"); const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); // const GoogleFontsPlugin = require("@beyonk/google-fonts-webpack-plugin") // const webpackFonts = require("./webpack.fonts.json") +const NODE_ENV = process.env.NODE_ENV || 'development'; module.exports = { ...defaultConfig, + devtool: 'development' === NODE_ENV ? 'eval-source-map' : undefined, + mode: NODE_ENV, entry: { "index": "./wordpress/index.tsx", "logo-maker": "./src/index.tsx" @@ -44,4 +47,4 @@ module.exports = { path: path.resolve(__dirname, "plugin_build"), clean: true } -}; \ No newline at end of file +};