You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by zh...@apache.org on 2021/06/02 15:55:19 UTC

[skywalking-client-js] branch mode created (now c4fe9b6)

This is an automated email from the ASF dual-hosted git repository.

zhangjuntao pushed a change to branch mode
in repository https://gitbox.apache.org/repos/asf/skywalking-client-js.git.


      at c4fe9b6  mode

This branch includes the following new commits:

     new c4fe9b6  mode

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[skywalking-client-js] 01/01: mode

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhangjuntao pushed a commit to branch mode
in repository https://gitbox.apache.org/repos/asf/skywalking-client-js.git

commit c4fe9b60cb9abac8b3efad33e4805c229effd57e
Author: Juntao Zhang <jt...@163.com>
AuthorDate: Wed Jun 2 23:52:42 2021 +0800

    mode
---
 package-lock.json | 25 +++++++++++++++++--------
 package.json      |  5 +++--
 webpack.config.js | 12 +++++++++---
 3 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 237587d..52479d2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1267,6 +1267,15 @@
         "yaml": "^1.10.0"
       }
     },
+    "cross-env": {
+      "version": "7.0.3",
+      "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
+      "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
+      "dev": true,
+      "requires": {
+        "cross-spawn": "^7.0.1"
+      }
+    },
     "cross-spawn": {
       "version": "7.0.3",
       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@@ -1301,7 +1310,7 @@
     },
     "dedent": {
       "version": "0.7.0",
-      "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz",
+      "resolved": "https://registry.npm.taobao.org/dedent/download/dedent-0.7.0.tgz",
       "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=",
       "dev": true
     },
@@ -2828,7 +2837,7 @@
     },
     "is-arrayish": {
       "version": "0.2.1",
-      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+      "resolved": "https://registry.npm.taobao.org/is-arrayish/download/is-arrayish-0.2.1.tgz",
       "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
       "dev": true
     },
@@ -2936,7 +2945,7 @@
     },
     "is-obj": {
       "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
+      "resolved": "https://registry.npm.taobao.org/is-obj/download/is-obj-1.0.1.tgz",
       "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
       "dev": true
     },
@@ -2985,7 +2994,7 @@
     },
     "is-regexp": {
       "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz",
+      "resolved": "https://registry.npm.taobao.org/is-regexp/download/is-regexp-1.0.0.tgz",
       "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=",
       "dev": true
     },
@@ -3110,7 +3119,7 @@
     },
     "lines-and-columns": {
       "version": "1.1.6",
-      "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
+      "resolved": "https://registry.npm.taobao.org/lines-and-columns/download/lines-and-columns-1.1.6.tgz",
       "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=",
       "dev": true
     },
@@ -4305,7 +4314,7 @@
     },
     "semver-compare": {
       "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
+      "resolved": "https://registry.npm.taobao.org/semver-compare/download/semver-compare-1.0.0.tgz",
       "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=",
       "dev": true
     },
@@ -4903,7 +4912,7 @@
     },
     "through": {
       "version": "2.3.8",
-      "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
+      "resolved": "https://registry.npm.taobao.org/through/download/through-2.3.8.tgz",
       "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
       "dev": true
     },
@@ -5656,7 +5665,7 @@
     },
     "which-pm-runs": {
       "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz",
+      "resolved": "https://registry.npm.taobao.org/which-pm-runs/download/which-pm-runs-1.0.0.tgz",
       "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=",
       "dev": true
     },
diff --git a/package.json b/package.json
index 65ba0d4..e4ddb62 100644
--- a/package.json
+++ b/package.json
@@ -12,6 +12,7 @@
     "email": "dev@skywalking.apache.org"
   },
   "devDependencies": {
+    "cross-env": "^7.0.3",
     "express": "^4.17.1",
     "husky": "^4.3.0",
     "lint-staged": "^10.3.0",
@@ -27,8 +28,8 @@
     "webpack-dev-server": "^3.11.2"
   },
   "scripts": {
-    "build": "webpack",
-    "rebuild": "rm -rf ./node_modules && rm -rf ./lib && npm install && webpack",
+    "build": "cross-env NODE_ENV=production webpack",
+    "rebuild": "rm -rf ./node_modules && rm -rf ./lib && npm install && npm run build",
     "start": "webpack-dev-server",
     "server": "node server.js",
     "release": "make release-src"
diff --git a/webpack.config.js b/webpack.config.js
index bbc0da9..8cb0a77 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -18,10 +18,10 @@ const path = require('path');
 const webpack = require('webpack');
 const WebpackConcatPlugin = require('webpack-concat-files-plugin');
 
-module.exports = {
+const isDev = process.env.NODE_ENV !== 'production';
+const config = {
   entry: './src/index.ts',
   devtool: 'inline-source-map',
-  mode: 'development',
   module: {
     rules: [
       {
@@ -41,7 +41,6 @@ module.exports = {
     publicPath: '/',
   },
   plugins: [
-    new webpack.HotModuleReplacementPlugin(),
     new WebpackConcatPlugin({
       bundles: [
         {
@@ -59,3 +58,10 @@ module.exports = {
     moduleIds: 'named',
   },
 };
+if (isDev) {
+  config.mode = 'development';
+  config.plugins.unshift(new webpack.HotModuleReplacementPlugin());
+} else {
+  config.mode = 'production';
+}
+module.exports = config;