node-modules

How do I properly set up my systemjs.config for use with ng2-codemirror?

强颜欢笑 提交于 2019-12-11 04:45:31
问题 I am attempting to import the codemirror ng2 module for use in an angular 2 app I am writing, and running into some setup issues. In doing this, I'm trying to follow along with my ng2-datetime-picker import, which DID work. Here is my system.js.config (function (global) { System.config({ path: { 'npm:' : 'node_modules/' }, map: { app: 'app', // ..... // a bunch of angular libraries // ...... 'ng2-datetime-picker': 'npm:ng2-datetime-picker/dist', // this works 'ng2-codemirror: 'npm:ng2

Does module.require(…).* return a copy of module.exports.* or a reference of it?

梦想的初衷 提交于 2019-12-11 02:05:53
问题 In the following code, are the "db" variables in session.js and user.js referencing to the same object in db.js, or are they copies of it (making separate connections to my db server)? // db.js var mongojs = require('mongojs'); var db = mongojs('test', ['users', 'sessions']); module.exports.database = db; // session.js var db = require('../db.js').database; ...... // user.js var db = require('../db.js').database; ...... Thanks! 回答1: Every call to require('../db.js') returns the same object,

Running “webpack” instead of “node_modules/.bin/webpack”

匆匆过客 提交于 2019-12-11 01:19:39
问题 I'm using to run " node_modules/.bin/webpack ", but I know it's possible to configure the path so that you only have to type " webpack ". I can't find how, though. :/ 回答1: That would happen if you install a package globally. For webpack that would be with the command npm install -g webpack . npm in that case would install Webpack in a set location you can find with npm root -g . If that location is in your $PATH , you can use webpack directly on your command line. Do not do that! You would

Relative Paths for SystemJS & ES module imports

╄→尐↘猪︶ㄣ 提交于 2019-12-11 00:54:01
问题 I'm having an issue with importing Angular2 components when using SystemJS and ES import syntax. Project structure: ROOT |_src |_client |_app |_frameworks |_il8n |_analytics |_main |_components |_pages |_utility Let's say I have a file: ROOT/src/client/app/frameworks/il8n/language-service.ts and another file: ROOT/src/client/app/main/pages/login/login.ts . In login.ts I want to import language.ts, so one way to do that is like so: //login.ts import { LanguageService } from '../../../..

Node app created by enclose module getting shuts down on idle in production mode

爱⌒轻易说出口 提交于 2019-12-11 00:51:39
问题 I am working with a node.js application whose .exe has been made using Enclose module, although it is working fine, only problem is that the application automatically shuts down after 10 minutes opening if left idle, no interaction with it. Is it because of "Process working time" and "Network connections" are Limited in the free version? Will the app run continuously without shutting down if i subscribe to the full version? Will this issue be permanently fixed for the exe builds created with

Create ES6 module 'equivalent' using webpack output.target options

邮差的信 提交于 2019-12-10 21:06:07
问题 Firstly, apologies! I struggled summing up the issue in the title so please feel free to amend. The problem Suppose I have two ES6 files that expose default functions // file_1.js export default function(){ /* do the thing */ } // file_2.js export default function(){ /* do the other thing */ } Now I bundle file_1 into a module using webpack (w/ babel loader) using the following output configuration // webpack config 1. { ... entry : '/path/to/file_1.js' output : { path: '/where/it/goes/',

How should i exclude all node_modules in electron-packager

喜欢而已 提交于 2019-12-10 20:25:12
问题 I'm using electron-packager for creating an electron.exe of my app. I need to exclude all node modules . I tried the following --ignore=node_modules The above is not working. Any idea how to exclude all folders/ remove node modules in final build. 回答1: If you install modules as devDependencies , they will all be pruned automatically before packaging. If you're using electron-builder you can define glob patterns as files in the config. In this case !**/node_modules/* will exclude all of node

Check versions in package json against actual node_modules

青春壹個敷衍的年華 提交于 2019-12-10 19:08:57
问题 Imagine the situation: We have a project with node_modules gitignored. While fixing a task developer1 updated package.json to newer version of some module, e.g. "dependencies": { "async": "^1.5.2", // was 1.5.1 ... Then he runned npm install locally to get updated module, performed tests, finished task and pushed changes on the server. Developer2 pulled changes from server and get app broken because still having previous version of async locally (1.5.1). And developer2 can waste a huge amount

node js - How do I create build for commercial usage?

笑着哭i 提交于 2019-12-10 18:06:13
问题 I am working on node js application and it is now ready to use. I want to make exe of this application so that it can be used for commercial usage. Up to now I have used enclose module using which I have compiled the code of application but I have found some issues in that (app got crash on idle condition). App is running good without enclose or compiled code. I have searched on google and found some alternate modules like JXcore, Node webkit and Electron etc. but JX core giving error same as

ASP .NET 5 - grunt task to copy files from node modules to wwwroot

ぃ、小莉子 提交于 2019-12-10 17:26:51
问题 I have a simple ASP .NET 5 empty project - with npm and grunt installed. I've used npm to install a few client-side libraries, at present located in the node_modules directory directly under my ASP .NET project. I want to copy the relevant files (for example, jquery.min.js) from the node_modules folder into the wwwroot folder. It's unclear to me how to use grunt to do this - as each node module has it's own dependency tree, and there doesn't seem to be any consistency in the file structure