duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

duo -w keeps building built files #469

Open darsain opened 9 years ago

darsain commented 9 years ago

When I start duo build process with watching enabled, it correctly builds the final file:

λ duo -w index.js

     building : index.js
        using : compatibility
        using : stoj
        built : index.js
        wrote : index.js

But as soon as I modify index.js, it builds twice, creating a duplicate file nested one level deeper:

     building : index.js
        using : compatibility
        using : stoj
        built : index.js
        wrote : index.js

     building : build\index.js
        using : compatibility
        using : stoj
        built : build\index.js
        wrote : index.js

So the file tree than looks like this:

build
├ index.js
└ build
  └ index.js
index.js

The next change than creates yet another level, as if directed by Nolan. It doesn't go deeper afterwards tough.

The index.js is just a one line with console.log() and no dependencies.

Environment: win 8.1 io.js v2.1.0

jruddell commented 9 years ago

are you giving a specific place to build to? what is your index.js file look like? I have a

duo.entry('index.js')
    .installTo('../components')
    .buildTo('../static/build')
    .... etc

that builds to the same place each time for me

darsain commented 9 years ago

@johnruddell index.js is the file being build, and as stated, it contains only a single line of code with console.log in it.

The file is being build with the

λ duo -w index.js

command.

Enabling the watch flag via the CLI (haven't tested it with API) is the key to the issue here. Any subsequent builds triggered by changes in index.js result in nesting.