通过intellij构建配置运行npm命令时,与使用终端

时间:2018-12-31 21:50:20

标签: javascript node.js intellij-idea

我已经定义了一个名为build-prod的构建过程,如下所示:

enter image description here

现在,当我运行此构建时:

enter image description here

它产生以下文件:

enter image description here

但是当我复制 exact命令时:

D:\Tools\nodejs\node.exe D:\Tools\nodejs\node_modules\npm\bin\npm-cli.js run build-prod --scripts-prepend-node-path=auto

并在终端中运行它:

enter image description here

它产生以下文件:

enter image description here

发生了什么事?

@edit通过终端3.js运行包含webpackJsonp,并且app.js将我的es6类转换为以下结构:

return function(e, t, n) {t && s(e.prototype, t), n && s(e, n);}(e, [
  {
    key: 'initState',
    value: function(e) {this.state = e || {commentHidePersistor: {}};},
  },
  {
    key: 'hideComments',
    value: function(e, t, n, r) {
      e.textContent = '[+]', t.classList.add(
          'collapsed'), this.state.commentHidePersistor[n] = this.state.commentHidePersistor[n] ||
          {collapsedThings: {}}, this.state.commentHidePersistor[n].lastUpdate = (new Date).getTime(), this.state.commentHidePersistor[n].collapsedThings[r] = !0, this.commentsStorage.saveAll(
          this.state), this.isElementInViewport(t) ||
      this.scrollToParent(t);
    },
  },

通过intellij app.js运行时保持es6格式:

}, i = new class {
  constructor(t) {this.commentsStorage = t;}

  initState(t) {this.state = t || {commentHidePersistor: {}};}

  hideComments(t, e, n, o) {
    t.textContent = '[+]', e.classList.add(
        'collapsed'), this.state.commentHidePersistor[n] = this.state.commentHidePersistor[n] ||
        {collapsedThings: {}}, this.state.commentHidePersistor[n].lastUpdate = (new Date).getTime(), this.state.commentHidePersistor[n].collapsedThings[o] = !0, this.commentsStorage.saveAll(
        this.state), this.isElementInViewport(e) || this.scrollToParent(e);
  }

0 个答案:

没有答案