简体   繁体   中英

Change Ember build directory (dist folder) without command line flags

I am trying to make my Ember project build to a directory outside of the project and for future builds I don't want to use command line flags each time. ember build --output-path=/not-dist will work for me but I want Ember to add the flag automatically.

    outputPaths: {
      app: {
        html: '../presentation/index.cfm',
        css: {
          'app': '../presentation/assets/ember-presentation-viewer.css'
        },
        js: '../presentation/assets/ember-presentation-viewer.js'
      },
      vendor: {
        css: '../presentation/assets/vendor.css',
        js: '../presentation/assets/vendor.js'
      }
    }

I have tried this as per the ember-cli documentation but ember-presentation-viewer.css was insisting on getting built in the dist directory with all the additional paths put there.

Is there a way to do this?

Go to package.json . Change scripts/build command:

"scripts": {
    "build": "ember build --output-path=/not-dist"
},

From now on, run:

npm run build

You can configure your .ember-cli.js file to specify flags that should always be included in your command line builds (in lower camel case), as per this page in the Ember docs. To change the output directory you'll want to add the following line: "outputPath": "../../example-folder/presentation" .

So your final .ember-cli.js should look like this:

{
  /*
    Ember CLI sends analytics information by default. The data is completely
    anonymous, but there are times when you might want to disable this behavior.

    Setting `disableAnalytics` to true will prevent any data from being sent.
  */
  "disableAnalytics": false,
  "outputPath": "../../example-folder/presentation"
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM