GithubHelp home page GithubHelp logo

Comments (5)

antonybudianto7 avatar antonybudianto7 commented on July 19, 2024

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.

darxx avatar darxx commented on July 19, 2024

I did node production mode. For angular 1.X examples can be taken from https://github.com/darxx/AngularWorkshop/tree/step6

from angular-starter.

antonybudianto7 avatar antonybudianto7 commented on July 19, 2024

@darxx , can you send a PR? I'll help where I can

from angular-starter.

darxx avatar darxx commented on July 19, 2024

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.

darxx avatar darxx commented on July 19, 2024

gulp build --exclude-source --prod

from angular-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.