From 088d7412f02c17ec85c871bcfa3f4979cb7fdfc2 Mon Sep 17 00:00:00 2001 From: Conrad Chan Date: Wed, 25 Mar 2020 10:02:44 -0700 Subject: [PATCH] chore: enable annotations sourcemaps while linked --- build/webpack.common.config.js | 6 +++++- package.json | 3 ++- yarn.lock | 8 ++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build/webpack.common.config.js b/build/webpack.common.config.js index d46b9c35e..106f9c35b 100644 --- a/build/webpack.common.config.js +++ b/build/webpack.common.config.js @@ -5,6 +5,10 @@ const { BannerPlugin, DefinePlugin, NormalModuleReplacementPlugin } = require('w const license = require('./license'); const pkg = require('../package.json'); +const isLinked = process.env.IS_LINKED === '1'; +const getAnnotationsPath = () => + isLinked ? /.*box-annotations\/dist\/.*/ : path.resolve('node_modules/box-annotations'); + /* eslint-disable global-require */ /* eslint-disable import/no-dynamic-require */ module.exports = language => { @@ -25,7 +29,7 @@ module.exports = language => { use: [MiniCssExtractPlugin.loader, 'css-loader', 'postcss-loader', 'sass-loader'], include: [ path.resolve('src/lib'), - path.resolve('node_modules/box-annotations'), + getAnnotationsPath(), path.resolve('node_modules/box-ui-elements'), ], }, diff --git a/package.json b/package.json index 61cbcbeda..21490a78c 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "babel-plugin-istanbul": "^5.2.0", "babel-plugin-react-remove-properties": "^0.3.0", "babel-plugin-transform-require-ignore": "^0.1.1", - "box-annotations": "^2.3.0", + "box-annotations": "^3.13.0", "box-ui-elements": "^12.0.0-beta.10", "chai": "^4.2.0", "chai-dom": "^1.8.1", @@ -141,6 +141,7 @@ "setup": "yarn install", "start": "yarn setup && yarn build:dev --watch", "start:dev": "yarn build:i18n && LANGUAGE=en-US BABEL_ENV=dev NODE_ENV=dev yarn webpack-dev-server --config build/webpack.config.js", + "start:dev:linked": "f() { yarn link ${@:-box-annotations} && IS_LINKED=1 yarn start:dev; }; f", "test": "yarn setup && yarn clean && yarn build:i18n && NODE_ENV=test yarn karma start build/karma.conf.js", "test:e2e": "npm-run-all -p -r start:dev cy:run", "test:e2e:open": "npm-run-all -p -r start:dev cy:open", diff --git a/yarn.lock b/yarn.lock index c5d8592ac..61ff88b10 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2309,10 +2309,10 @@ boom@5.x.x: dependencies: hoek "4.x.x" -box-annotations@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/box-annotations/-/box-annotations-2.3.0.tgz#5cac38171f7f8d9283659e2b243310f19d5ab7d3" - integrity sha512-Ea7tPgyJjX7vcnmZIfCorbzHd6oYx/OHVMPnZVQL/dUHR5vRKhLM0610xqwmVlUpk627sqHw5x/APaa+kt4SXg== +box-annotations@^3.13.0: + version "3.13.0" + resolved "https://registry.yarnpkg.com/box-annotations/-/box-annotations-3.13.0.tgz#053a34ef2ad7d5796beac811f481e2d1f4eee130" + integrity sha512-TRTrMprLfaBUwPJJ2bDpiLPv1/EopPhMCWmQPEhaiwrvfwYiI+uC6Aa0h0wREZpeqpcbxbc1AH8yMYSS7+vtwg== box-ui-elements@^12.0.0-beta.10: version "12.0.0-beta.10"