This commit is contained in:
Rikki Gibson 2018-10-04 15:29:22 -07:00
Родитель 116202b7c9
Коммит e2ca883385
7 изменённых файлов: 67 добавлений и 66 удалений

14
.gitignore поставляемый
Просмотреть файл

@ -58,8 +58,14 @@ jspm_packages/
*.user
.ntvs_analysis.dat
obj/*
typings/
dist/
output/
typedoc
# Typescript output
dist/
*.d.ts
*.d.ts.map
*.js
*.js.map
# Rollup
!rollup.config.js
*stats.html

Просмотреть файл

@ -1,9 +0,0 @@
.vscode/
node_modules/
samples/
test/
.travis.yml
gulpfile.js
.gitignore
dist/test
*.ts

Просмотреть файл

@ -21,21 +21,32 @@
"environment",
"endpoint"
],
"main": "./dist/lib/azureEnvironment.js",
"types": "./typings/lib/azureEnvironment.d.ts",
"main": "./dist/msRestAzureEnv.js",
"module": "./es/lib/azureEnvironment.js",
"types": "./es/lib/azureEnvironment.d.ts",
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"es/lib/**/*.js",
"es/lib/**/*.js.map",
"es/lib/**/*.d.ts",
"es/lib/**/*.d.ts.map",
"lib/**/*.ts",
"LICENSE",
"README.md"
],
"license": "MIT",
"devDependencies": {
"@types/mocha": "^2.2.40",
"@types/should": "^8.1.30",
"@types/webpack": "^4.1.3",
"mocha": "^5.2.0",
"npm-run-all": "^4.1.3",
"rollup": "^0.66.4",
"should": "5.2.0",
"ts-loader": "^4.5.0",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^3.0.1",
"webpack": "^4.17.1",
"webpack-cli": "^3.1.0"
"typescript": "^3.1.1"
},
"homepage": "https://github.com/Azure/ms-rest-azure-env",
"repository": {
@ -46,11 +57,14 @@
"url": "http://github.com/Azure/ms-rest-azure-env/issues"
},
"scripts": {
"tsc": "tsc -p tsconfig.json",
"test": "npm -s run-script tslint && npm -s run-script unit",
"unit": "mocha -t 50000 dist/test",
"build": "npm -s run-script tsc && webpack",
"tslint": "tslint -p . -c tslint.json --exclude test/**/*.ts",
"build": "run-s build:tsc build:rollup build:minify",
"build:tsc": "tsc -p tsconfig.es.json",
"build:rollup": "rollup -c rollup.config.js",
"build:minify": "uglifyjs -c -m --comments --source-map \"content='./dist/msRestAzureEnv.js.map'\" -o ./dist/msRestAzureEnv.min.js ./dist/msRestAzureEnv.js",
"test": "run-p test:tslint test:unit",
"test:tslint": "tslint -p . -c tslint.json --exclude test/**/*.ts",
"test:unit": "mocha dist/test",
"prepare": "npm run build"
}
},
"sideEffects": false
}

22
rollup.config.js Normal file
Просмотреть файл

@ -0,0 +1,22 @@
const banner = `/** @license ms-rest-azure-env
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/`;
/**
* @type {import('rollup').RollupFileOptions}
*/
const config = {
input: './es/lib/azureEnvironment.js',
external: [],
output: {
file: "./dist/msRestAzureEnv.js",
format: "umd",
name: "Azure",
sourcemap: true,
banner
},
plugins: []
}
export default config;

7
tsconfig.es.json Normal file
Просмотреть файл

@ -0,0 +1,7 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"module": "es6",
"outDir": "es"
}
}

Просмотреть файл

@ -6,7 +6,7 @@
"preserveConstEnums": true,
"sourceMap": true,
"newLine": "LF",
"target": "es2015",
"target": "es5",
"moduleResolution": "node",
"noImplicitReturns": true,
"noImplicitThis": true,
@ -14,7 +14,7 @@
"noUnusedParameters": true,
"outDir": "dist",
"declaration": true,
"declarationDir": "typings",
"declarationMap": true,
"allowJs": false,
"strict": true,
"strictNullChecks": true,

Просмотреть файл

@ -1,39 +0,0 @@
import * as webpack from 'webpack';
const config: webpack.Configuration = {
mode: "production",
entry: './lib/azureEnvironment.ts',
devtool: 'source-map',
output: {
filename: 'azureEnvironmentBundle.js',
path: __dirname,
libraryTarget: 'var',
library: 'azureEnvironment'
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /(node_modules|test)/
}
]
},
resolve: {
extensions: [".tsx", ".ts", ".js"]
},
node: {
fs: false,
net: false,
path: false,
dns: false,
tls: false,
tty: false,
v8: false,
Buffer: false,
process: false,
stream: false
}
};
export = config;