generator-fountain-webapp
generator-fountain-webapp copied to clipboard
Gulp tasks fail on Windows 10
Description
Gulp tasks error on Windows 10 for all project types tested (angular 1, angular 2, with TypeScript, with SystemJS, with Webpack, TodoMVC, or just with basic application)
Error Message & Stack Trace
[09:43:41] Finished 'styles' after 1.14 s [09:43:42] 'systemjs' errored after 2.6 s [09:43:42] Error on fetch for app/hello.ts at file:///[USER-PATH]/Projects/Test/Fountain/app/hello.ts Loading src\index.ts Error: ENOENT: no such file or directory, open 'C:[USER-PATH]\Projects\Test\Fountain\app\hello.ts' at Error (native) [09:43:42] 'build' errored after 2.65 s [09:43:42] 'default' errored after 2.66 s
Config
{ "generator-fountain-angular1": { "version": "1.0.0-rc1", "props": { "framework": "angular1", "modules": "systemjs", "js": "typescript", "ci": [], "css": "scss", "resolved": "C:\[USER-PATH]\AppData\Roaming\npm\node_modules\generator-fountain-webapp\node_modules\generator-fountain-angular1\generators\app\index.js", "namespace": "fountain-angular1", "argv": { "remain": [], "cooked": [], "original": [] }, "sample": "hello", "router": "uirouter" } } }
Environment
Node.js v6.6.0 win32 10.0.14393
NPM: 3.10.3 Yeoman: 1.8.5
I'm having the same problem and i think i have identified the issue (though i don't know how to solve it at the moment). The task systemjs
function systemjs(done) {
const builder = new Builder('./', 'jspm.config.js');
builder.config({
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},
packageConfigPaths: [
'npm:@*/*.json',
'npm:*.json',
'github:*/*.json'
]
});
builder.buildStatic(
`${conf.path.src('index.ts')} + ${conf.path.tmp('templateCacheHtml.ts')}`,
conf.path.tmp('index.js'),
{
production: true,
browser: true
}
).then(() => {
done();
}, done);
}
builds from index.ts which imports from ./app
import {TodoService} from './app/todos/todos.ts';
import {App} from './app/containers/App.ts';
import {Header} from './app/components/Header.ts';
import {MainSection} from './app/components/MainSection.ts';
import {TodoTextInput} from './app/components/TodoTextInput.ts';
import {TodoItem} from './app/components/TodoItem.ts';
import {Footer} from './app/components/Footer.ts';
import 'angular-ui-router';
import routesConfig from './routes.ts';
so when building gulp the root folder is the project folder, not the src folder (which contains app), therefore it will look for "projectname/app/files" rather than "projectname/src/app/files" when importing from index.ts
I have found this: https://github.com/FountainJS/generator-fountain-webapp/issues/81 the last comment has a solution for Angular 1 + systemjs