How do I change the source directory in Dart / Pub config?

I couldn't find an answer to this in the Dart documentation.

My server side application is spray driven and by convention static files are stored in a folder /webapp

. When I try to create a Dart project, I get the following error:

C:\work\externals\dart-sdk\bin\pub.bat build --mode=release
Your package must have a "web" directory, or you must specify the source directories.

      

How can I change it from web

to webapp

? Mine pubspec.yaml

looks like this

name:  dart_spray_example
description:  A sample Dart/Spray application

dependencies:
  browser: any

      

Here is the location of my application right now

enter image description here

+3


source to share


1 answer


You just pass it in as an optional argument.

pub build --mode=release webapp

      

but I would expect problems to run this way because only some of the top-level directory names match the layout of the folder package .

pub build --mode=release example

      



will be good.

It might be easier to use web

as source directory and move the generated output to webapp

. I know this can cause problems during development, but I would expect it to be easier to fix the development setup instead of the build setup.

The use of frameworks like Angular and Polymer, which make heavy use of transformers, are highly dependent on the packaging conventions.

+3


source







All Articles