Comments (5)
Thanks, I'd love to accept a PR for this.
I updated the title to reflect the real issue, since the production build is okay, but not "node best practice"
from angular-starter.
I did node production mode. For angular 1.X examples can be taken from https://github.com/darxx/AngularWorkshop/tree/step6
from angular-starter.
@darxx , can you send a PR? I'll help where I can
from angular-starter.
Yes. After work I will try to figure it out. Now I`m thinking to use global.env and separate gulp.config.js part that is using
if (global.env === 'dev') {
var historyApiFallback = require('connect-history-api-fallback');
}
module.exports = function () {
And
if (global.env === 'dev')
{
var browserSync = {
dev: {
port: 3000,
server: {
baseDir: './src/',
middleware: [historyApiFallback()],
routes: {
"/node_modules": "node_modules",
"/src": "src"
}
},
files: [
src + "index.html",
src + "systemjs.conf.js",
src + "assets/styles/main.css",
tmpApp + "/*.js",
app + "/.css",
app + "__/.html"
]
},
prod: {
port: 3001,
server: {
baseDir: './' + build.path,
middleware: [historyApiFallback()]
}
}
};
}
and
var config = {
root: root,
translations: translations,
src: src,
app: app,
test: test,
tmp: tmp,
tmpApp: tmpApp,
tmpTest: tmpTest,
tmpE2E: tmpE2E,
testHelper: testHelper,
e2e: e2e,
e2eConfig: e2eConfig,
assets: assets,
index: index,
build: build,
report: report,
assetsPath: assetsPath,
tsFiles: tsFiles,
tsTestFiles: tsTestFiles,
systemJs: systemJs
};
if (global.env === 'dev')
{
config.browserSync = browserSync;
}
And now I`m getting
07 06 2016 15:34:03.353:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
07 06 2016 15:34:03.363:INFO [launcher]: Starting browser PhantomJS
07 06 2016 15:34:04.918:INFO [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Connected on socket /#2elfkEsL-DS8sZ26AAAA with id 62765646
07 06 2016 15:34:07.171:WARN [web-server]: 404: /base/node_modules/karma-ie-launcher/test/launcher.spec
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
Error: XHR error (404 Not Found) loading http://localhost:9876/node_modules/karma-ie-launcher/test/launcher.spec
Error loading http://localhost:9876/node_modules/karma-ie-launcher/test/launcher.spec
Remapping coverage to TypeScript format...
Test Done with exit code: 1
[15:34:07] 'unit-test' errored after 26 s
[15:34:07] Error: 1
at formatError (C:\Users\darlau\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:169:10)
at Gulp. (C:\Users\darlau\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:195:15)
at emitOne (events.js:95:20)
at Gulp.emit (events.js:182:7)
at Gulp.Orchestrator._emitTaskDone (C:\dev\coreUI\node_modules\orchestrator\index.js:264:8)
at C:\dev\coreUI\node_modules\orchestrator\index.js:275:23
at finish (C:\dev\coreUI\node_modules\orchestrator\lib\runTask.js:21:8)
at cb (C:\dev\coreUI\node_modules\orchestrator\lib\runTask.js:29:3)
at DestroyableTransform. (C:\dev\coreUI\tasks\test.js:59:13)
at emitNone (events.js:85:20)
at DestroyableTransform.emit (events.js:179:7)
at finishMaybe (C:\dev\coreUI\node_modules\through2\node_modules\readable-stream\lib_stream_writable.js:475:14)
at endWritable (C:\dev\coreUI\node_modules\through2\node_modules\readable-stream\lib_stream_writable.js:485:3)
at DestroyableTransform.Writable.end (C:\dev\coreUI\node_modules\through2\node_modules\readable-stream\lib_stream_writable.js:455:41)
at DestroyableTransform.onend (C:\dev\coreUI\node_modules\vinyl-fs\node_modules\readable-stream\lib_stream_readable.js:523:10)
at DestroyableTransform.g (events.js:273:16)
at emitNone (events.js:85:20)
at DestroyableTransform.emit (events.js:179:7)
at C:\dev\coreUI\node_modules\vinyl-fs\node_modules\readable-stream\lib_stream_readable.js:965:16
at _combinedTickCallback (node.js:376:9)
at process._tickCallback (node.js:407:11)
[15:34:07] 'build' errored after 31 s
[15:34:07] Error in plugin 'run-sequence(unit-test)'
Message:
unit-test callback
Remapping done! View the result in report/remap/html-report
At home I will have more time to figure it out.
from angular-starter.
gulp build --exclude-source --prod
from angular-starter.
Related Issues (20)
- problem between npm start and npm run build on style sheet HOT 2
- remove Todolist module HOT 2
- import { filter } from 'lodash'; HOT 2
- materialize (question) HOT 2
- npm run build no long deployes properly HOT 1
- npm run build is broken HOT 1
- Problem with report generation HOT 3
- No file change on the screen, despite recompile (RaydonZhu comment) HOT 7
- Serving from the root folder HOT 6
- Move the src folder contents HOT 2
- Update to typescript 2.1?
- where is tree shaking config? HOT 1
- lodash Partial - too old Typescript used HOT 1
- does it support lazy loading? HOT 1
- Lazy loading HOT 1
- Can't start freshly cloned project. HOT 4
- Debug TS files not working in Chrome HOT 2
- How do I switch this project to support universial HOT 1
- Will it work with Visual Studio . I tried but facing some unexpected token errors while loading files HOT 6
- Upgrade to Angular 5 causing remap-istanbul html report generation to fail HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-starter.