How to share gulp tasks using npm?How can I update NodeJS and NPM to the next versions?Find the version of an installed npm packageHow do I update each dependency in package.json to the latest version?npm throws error without sudoWhat is the difference between Bower and npm?What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?What is the --save option for npm install?Gulp error in WebStorm: Failed to list gulp tasksImporting lodash into angular2 + typescript applicationNPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack
Golf (6-card) Golf!
How to deal with a Homophobic PC
Why, even after his imprisonment, people keep calling Hannibal Lecter "Doctor"?
Difference between types of yeast
Do I have advantage with Riposte when moving away from a flanked enemy and triggering an opportunity attack?
Why is a road bike faster than a city bike with the same effort? & how much faster it can be?
Examples of "unsuccessful" theories with afterlives
Do wheelchair aircraft exist?
Do we have any particular tonal center in mind when we are NOT listening music?
A file manager to open a zip file like opening a folder, instead of extract it by using a archive manager
Excel Solver linear programming - Is it possible to use average of values as a constraint without #DIV/0! errors or sacrificing linearity?
Symbol for function composition like a big sum
Can an integer optimization problem be convex?
Is it more effective to add yeast before or after kneading?
My manager quit. Should I agree to defer wage increase to accommodate budget concerns?
Is there something that can completely prevent the effects of the Hold Person spell?
What would influence an alien race to map their planet in a way other than the traditional map of the Earth
Why are there two fundamental laws of logic?
Is there a way to hide HTML source code yet keeping it effective?
Under what circumstances would RAM locations 0 and 1 be written and/or read on the C64?
Is it a good idea to leave minor world details to the reader's imagination?
practicality of 30 year fix mortgage at 55 years of age
Going to France with limited French for a day
Why did the Soviet Union not "grant" Inner Mongolia to Mongolia after World War Two?
How to share gulp tasks using npm?
How can I update NodeJS and NPM to the next versions?Find the version of an installed npm packageHow do I update each dependency in package.json to the latest version?npm throws error without sudoWhat is the difference between Bower and npm?What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?What is the --save option for npm install?Gulp error in WebStorm: Failed to list gulp tasksImporting lodash into angular2 + typescript applicationNPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a large scale project with multiple sub projects that share some common gulp tasks. I am planning on developing these gulp tasks as a separate npm library.
What I have done so far is, creating a TypeScript project that contains following structure,
GulpLibrary
src
tasks
clean.ts
build.ts
publish.ts
utils
task-helpers.ts
constants.ts
gulpfile.ts
index.ts
gulpfile.js
tsconfig.json
package.json
srctasks**
contains all gulp tasks.srcutils**
contains all common logics.srcgulpfile.ts
is as follows,
import './tasks/clean';
import './tasks/build';
import './tasks/publish';
gulpfile.js
is as follows,
'use strict';
const path = require('path');
// Register TS compilation.
require('ts-node').register(
project: path.join(__dirname, '/tsconfig.json')
);
require('./src/gulpfile');
tsconfig.json
is as follows,
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions":
"target": "es5",
"lib": ["es6", "es2015"],
"moduleResolution": "node",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"noEmitOnError": true,
"noImplicitAny": true,
"sourceMap": false,
"inlineSources": true,
"stripInternal": true,
"rootDir": "./src",
"outDir": "./dist/mytools",
"strict": true
,
"types": [
"node"
],
"typeRoots": [
"node_modules/@types"
],
"include": [
"**/*.ts"
],
"exclude": [
"node_modules",
"./dist"
]
When I run gulp --tasks
inside the GulpLibrary
, all tasks get listed as expected.
But when I run gulp --tasks
in my other project the task list does not show up. Following is the steps I have followed to install above tasks into my other project.
- Compile typescript files using the tsconfig shown above (used the same gulp task in this library)
- In my other project, ran
npm install pathtodistmytools
, and the package get installed in node_modules. - In my other project, created a
gulpfile.js
in project root. Content of the file is as follows,
'use strict';
require('@tc-devkit/tools/gulpfile');
Why doesn't the tasks list as expected?
ADDITIONAL NOTE:
If I run, gulp --tasks -f=node_modulesmytoolsgulpfile.js
tasks get listed properly.
node.js typescript npm gulp
add a comment
|
I have a large scale project with multiple sub projects that share some common gulp tasks. I am planning on developing these gulp tasks as a separate npm library.
What I have done so far is, creating a TypeScript project that contains following structure,
GulpLibrary
src
tasks
clean.ts
build.ts
publish.ts
utils
task-helpers.ts
constants.ts
gulpfile.ts
index.ts
gulpfile.js
tsconfig.json
package.json
srctasks**
contains all gulp tasks.srcutils**
contains all common logics.srcgulpfile.ts
is as follows,
import './tasks/clean';
import './tasks/build';
import './tasks/publish';
gulpfile.js
is as follows,
'use strict';
const path = require('path');
// Register TS compilation.
require('ts-node').register(
project: path.join(__dirname, '/tsconfig.json')
);
require('./src/gulpfile');
tsconfig.json
is as follows,
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions":
"target": "es5",
"lib": ["es6", "es2015"],
"moduleResolution": "node",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"noEmitOnError": true,
"noImplicitAny": true,
"sourceMap": false,
"inlineSources": true,
"stripInternal": true,
"rootDir": "./src",
"outDir": "./dist/mytools",
"strict": true
,
"types": [
"node"
],
"typeRoots": [
"node_modules/@types"
],
"include": [
"**/*.ts"
],
"exclude": [
"node_modules",
"./dist"
]
When I run gulp --tasks
inside the GulpLibrary
, all tasks get listed as expected.
But when I run gulp --tasks
in my other project the task list does not show up. Following is the steps I have followed to install above tasks into my other project.
- Compile typescript files using the tsconfig shown above (used the same gulp task in this library)
- In my other project, ran
npm install pathtodistmytools
, and the package get installed in node_modules. - In my other project, created a
gulpfile.js
in project root. Content of the file is as follows,
'use strict';
require('@tc-devkit/tools/gulpfile');
Why doesn't the tasks list as expected?
ADDITIONAL NOTE:
If I run, gulp --tasks -f=node_modulesmytoolsgulpfile.js
tasks get listed properly.
node.js typescript npm gulp
add a comment
|
I have a large scale project with multiple sub projects that share some common gulp tasks. I am planning on developing these gulp tasks as a separate npm library.
What I have done so far is, creating a TypeScript project that contains following structure,
GulpLibrary
src
tasks
clean.ts
build.ts
publish.ts
utils
task-helpers.ts
constants.ts
gulpfile.ts
index.ts
gulpfile.js
tsconfig.json
package.json
srctasks**
contains all gulp tasks.srcutils**
contains all common logics.srcgulpfile.ts
is as follows,
import './tasks/clean';
import './tasks/build';
import './tasks/publish';
gulpfile.js
is as follows,
'use strict';
const path = require('path');
// Register TS compilation.
require('ts-node').register(
project: path.join(__dirname, '/tsconfig.json')
);
require('./src/gulpfile');
tsconfig.json
is as follows,
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions":
"target": "es5",
"lib": ["es6", "es2015"],
"moduleResolution": "node",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"noEmitOnError": true,
"noImplicitAny": true,
"sourceMap": false,
"inlineSources": true,
"stripInternal": true,
"rootDir": "./src",
"outDir": "./dist/mytools",
"strict": true
,
"types": [
"node"
],
"typeRoots": [
"node_modules/@types"
],
"include": [
"**/*.ts"
],
"exclude": [
"node_modules",
"./dist"
]
When I run gulp --tasks
inside the GulpLibrary
, all tasks get listed as expected.
But when I run gulp --tasks
in my other project the task list does not show up. Following is the steps I have followed to install above tasks into my other project.
- Compile typescript files using the tsconfig shown above (used the same gulp task in this library)
- In my other project, ran
npm install pathtodistmytools
, and the package get installed in node_modules. - In my other project, created a
gulpfile.js
in project root. Content of the file is as follows,
'use strict';
require('@tc-devkit/tools/gulpfile');
Why doesn't the tasks list as expected?
ADDITIONAL NOTE:
If I run, gulp --tasks -f=node_modulesmytoolsgulpfile.js
tasks get listed properly.
node.js typescript npm gulp
I have a large scale project with multiple sub projects that share some common gulp tasks. I am planning on developing these gulp tasks as a separate npm library.
What I have done so far is, creating a TypeScript project that contains following structure,
GulpLibrary
src
tasks
clean.ts
build.ts
publish.ts
utils
task-helpers.ts
constants.ts
gulpfile.ts
index.ts
gulpfile.js
tsconfig.json
package.json
srctasks**
contains all gulp tasks.srcutils**
contains all common logics.srcgulpfile.ts
is as follows,
import './tasks/clean';
import './tasks/build';
import './tasks/publish';
gulpfile.js
is as follows,
'use strict';
const path = require('path');
// Register TS compilation.
require('ts-node').register(
project: path.join(__dirname, '/tsconfig.json')
);
require('./src/gulpfile');
tsconfig.json
is as follows,
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions":
"target": "es5",
"lib": ["es6", "es2015"],
"moduleResolution": "node",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"noEmitOnError": true,
"noImplicitAny": true,
"sourceMap": false,
"inlineSources": true,
"stripInternal": true,
"rootDir": "./src",
"outDir": "./dist/mytools",
"strict": true
,
"types": [
"node"
],
"typeRoots": [
"node_modules/@types"
],
"include": [
"**/*.ts"
],
"exclude": [
"node_modules",
"./dist"
]
When I run gulp --tasks
inside the GulpLibrary
, all tasks get listed as expected.
But when I run gulp --tasks
in my other project the task list does not show up. Following is the steps I have followed to install above tasks into my other project.
- Compile typescript files using the tsconfig shown above (used the same gulp task in this library)
- In my other project, ran
npm install pathtodistmytools
, and the package get installed in node_modules. - In my other project, created a
gulpfile.js
in project root. Content of the file is as follows,
'use strict';
require('@tc-devkit/tools/gulpfile');
Why doesn't the tasks list as expected?
ADDITIONAL NOTE:
If I run, gulp --tasks -f=node_modulesmytoolsgulpfile.js
tasks get listed properly.
node.js typescript npm gulp
node.js typescript npm gulp
asked Mar 28 at 17:36
charith.arumapperumacharith.arumapperuma
3071 gold badge2 silver badges15 bronze badges
3071 gold badge2 silver badges15 bronze badges
add a comment
|
add a comment
|
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55403762%2fhow-to-share-gulp-tasks-using-npm%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55403762%2fhow-to-share-gulp-tasks-using-npm%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown