📌 Improve your Angular CLI skills with this free Angular CLI course on Pluralsight

Initializing the Scully app

I was attempting to initialize a brand new Scully Application inside of a pre-existing Angular app when I came across this error:

Your distribution files are in "dist". Please change that to include a subfolder

This error appeared after I first ran ng add @scullyio/init followed by ng build --prod && npx scully --scanRoutes.

My initial reaction was to think about how Scully outputs the static content for our app.

Scully will output the static content to ./dist/static by default. For this reason, you can't have the outputPath for your Angular application be set to the default dist folder.

Solution to the Error

In your angular.json configuration file in the route of your app, change the following property to something other than dist

projects > architect > build > options > output path

I changed the outputPath of my Angular application to dist/public.

After the update, the build section of my angular.json file looks like this:

"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": {
    "outputPath": "dist/public",
    "index": "src/index.html",
    "main": "src/main.ts",
    "polyfills": "src/polyfills.ts",
    "tsConfig": "tsconfig.app.json",

This change to your angular.json will resolve the Your distribution files are in "dist" error message when initializing your Scully app.

📌 Improve your Angular CLI skills with this free Angular CLI course on Pluralsight
Related Blog Posts