Last active
January 16, 2020 13:50
-
-
Save JiteBot/fe9a847ef01239f86df00f337b8bc63e to your computer and use it in GitHub Desktop.
NPM Boilerplate templates.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include: | |
- https://gitlab.com/jitesoft/gitlab-ci-lib/raw/master/dependency_scanning.yml | |
- https://gitlab.com/jitesoft/gitlab-ci-lib/raw/master/js_common.yml | |
- | |
stages: | |
- test | |
- scan | |
- deploy | |
test: | |
extends: .npm:test | |
scan: | |
extends: .scan:npm | |
deploy: | |
extends: .npm:build:deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "my-package", | |
"description": "Just another npm package.", | |
"main": "dist/index.js", | |
"module": "src/index.js", | |
"keywords": [], | |
"author": "", | |
"license": "MIT", | |
"readmeFilename": "README.md", | |
"dependencies": {}, | |
"devDependencies": { | |
"@babel/core": "^7", | |
"@jitesoft/babel-preset-main": "^2", | |
"@jitesoft/eslint-config": "^1", | |
"babel-eslint": "^10", | |
"babel-jest": "^24", | |
"babel-loader": "^8", | |
"core-js": "^3", | |
"cross-env": "^6", | |
"eslint": "^6", | |
"jest": "^24", | |
"webpack": "^4", | |
"webpack-cli": "^3" | |
}, | |
"scripts": { | |
"test": "eslint src && jest && npm audit", | |
"build:prod": "cross-env NODE_ENV=production webpack -p", | |
"build:dev": "cross-env NODE_ENV=develop webpack" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Path = require('path'); | |
const packageName = require('./package').name; | |
module.exports = { | |
mode: 'production', | |
target: 'web', | |
entry: { | |
'index': [ | |
Path.join(__dirname, 'src', 'index.js') | |
] | |
}, | |
output: { | |
filename: '[name].js', | |
libraryTarget: 'umd', | |
library: packageName, | |
globalObject: "typeof self !== 'undefined' ? self : this" | |
}, | |
optimization: { | |
minimize: true | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: [/node_modules/], | |
loader: 'babel-loader' | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment