ZachJW34 / nx-plus

Collection of Nx Community Plugins
MIT License
300 stars 52 forks source link

@nx-plus/nuxt:static dont behavior like nuxt generate ignoring dir folder on nuxt.config #277

Open schirrel opened 1 year ago

schirrel commented 1 year ago

Current Behavior

I am need to build static SSG with nuxt and the build output must be on exactly dist/production but when i use the yarn nx static from @nx-plus/nuxt:static it always generate the "/dist" folder.

I had even add the below code on my nuxt.config.js but it was ignored

  target: 'static',
  generate: {
    dir: '../../dist/production',
    fallback: true,

  },

I hade also set "buildDir": "dist/production" on project.json but the nx-plus keeps generating a dist folder inside the dist/production folder, image:

Captura de Tela 2022-11-09 às 18 18 24

I've tried to use nx:run-commands to see if my config on nuxt.config.js was wrong, but with nuxt generate" the distfolder is not generate inside the dist/production, see:

Captura de Tela 2022-11-09 às 18 20 52

Expected Behavior

@nx-plus/nuxt:static respect the build defined at nuxt.config.js under generate.dir prop, like the nuxt generate does:

Captura de Tela 2022-11-09 às 18 20 52

Steps to Reproduce

Fork: https://github.com/schirrel/nx-nuxt-vue

Environment

Plugin name and version: "@nx-plus/nuxt": "14.1.0",

   Node : 16.16.0
   OS   : darwin arm64
   yarn : 1.22.19

   nx : 14.5.6
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.5.6
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.5.6
   @nrwl/eslint-plugin-nx : 14.5.6
   @nrwl/express : Not Found
   @nrwl/jest : 14.5.6
   @nrwl/js : 14.5.6
   @nrwl/linter : 14.5.6
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/workspace : 14.5.6
   typescript : 4.7.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
         @nx-plus/nuxt: 14.1.0
         @nx-plus/vue: 14.1.0
schirrel commented 1 year ago

hey @ZachJW34 i've found where it need to be change, what you say? can i open a pr? or may we need to discuss this? Basically the static generator keeps using the browser build instead of the generator

schirrel commented 1 year ago

@ZachJW34 @BuckyMaler could you see this?