Skip to content

Can't run ng serve when I want an asset to be written to a location outside the project. #8652

Closed

Description

@Dani2kn

Versions

Angular CLI: 1.5.4
Node: 8.9.1
OS: win32 x64
Angular: 5.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.4
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.21
@angular-devkit/schematics: 0.0.37
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.4
@schematics/angular: 0.1.7
typescript: 2.4.2
webpack: 3.8.1

Repro steps

  • Step 1 - in the project folder run command ng new angular-src
  • Step 2 - modify the .angular-cli.json
"apps": [
    {
      "root": "src",
      "outDir": "../public",

and

  "assets": [
        {
          "glob": "**/*",
          "input": "./assets/",
          "output": "../public",
          "allowOutsideOutDir": true
        },
        {
          "glob": "favicon.ico",
          "input": "./",
          "output": "../public",
          "allowOutsideOutDir": true
        }

  • Step 3 - run ng serve

Observed behavior

D:\Programare\NodeJS\MeanAuthApp\angular-src>ng serve
An asset cannot be written to a location outside the project.

Desired behavior

I want to be able to run ng serve with the location outDir: "../public"

Mention any other details that might be useful (optional)

I want to achieve the same output presented in the beginning of this tutorial linked below. And hope this will help! Many thanks!

https://www.youtube.com/watch?v=zrViDpWiNVE&list=PLillGF-RfqbZMNtaOXJQiDebNXjVapWPZ&index=5

Activity

  1. filipesilva commented on Nov 28, 2017

    @filipesilva
    Contributor

    This issue is a duplicate of #8613, fixed by #8630, which will be in the next release.

  2. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  3. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions