From f84a99a836d964137b9cc58be3b0593218f3cf8f Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 14 Dec 2020 12:00:43 +0100 Subject: [PATCH] Fix yarn watch (#587) * Fix yarn watch * Wtach-only config * --mode development for watch * build:ui --- package.json | 5 +++-- packages/extension/webpack.shared.js | 1 - packages/extension/webpack.watch.js | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 packages/extension/webpack.watch.js diff --git a/package.json b/package.json index 67a9fa87..b62bdec6 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,10 @@ }, "scripts": { "build": "polkadot-dev-build-ts && yarn build:zip", - "build:extra": "yarn build:i18n && (cd packages/extension && yarn webpack --config webpack.extension.js)", + "build:extra": "yarn build:i18n && yarn build:ui", "build:i18n": "i18next-scanner --config i18next-scanner.config.js", "build:release": "polkadot-ci-ghact-build", + "build:ui": "cd packages/extension && yarn webpack --config webpack.extension.js --mode production", "build:zip": "yarn build:zip:dst && yarn build:zip:src", "build:zip:dst": "rm -rf ./master-build.zip && cd packages/extension/build && zip -r -FS ../../../master-build.zip .", "build:zip:src": "rm -rf ./master-src.zip && zip -r -x '*build/*' -x '*node_modules*' -FS ./master-src.zip packages .babelrc.js .editorconfig .eslintignore .eslintrc.js babel.config.js CHANGELOG.md CONTRIBUTING.md i18next-scanner.config.js jest.config.js lerna.json LICENSE package.json README.md tsconfig.json yarn.lock", @@ -32,7 +33,7 @@ "postinstall": "polkadot-dev-yarn-only", "start": "yarn watch", "test": "polkadot-dev-run-test", - "watch": "cd packages/extension && yarn polkadot-exec-webpack --config webpack.config.js --watch" + "watch": "cd packages/extension && yarn polkadot-exec-webpack --config webpack.watch.js --mode development --watch" }, "devDependencies": { "@babel/core": "^7.12.10", diff --git a/packages/extension/webpack.shared.js b/packages/extension/webpack.shared.js index 38c7d25a..5fbe02f3 100644 --- a/packages/extension/webpack.shared.js +++ b/packages/extension/webpack.shared.js @@ -22,7 +22,6 @@ module.exports = (entry, alias = {}) => ({ context: __dirname, devtool: false, entry, - mode: 'production', module: { rules: [ { diff --git a/packages/extension/webpack.watch.js b/packages/extension/webpack.watch.js new file mode 100644 index 00000000..19218e29 --- /dev/null +++ b/packages/extension/webpack.watch.js @@ -0,0 +1,11 @@ +// Copyright 2019-2020 @polkadot/extension authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +const createConfig = require('./webpack.shared.js'); + +module.exports = createConfig({ + background: './src/background.ts', + content: './src/content.ts', + extension: './src/extension.ts', + page: './src/page.ts' +});