Move tsconfig files to root, and made webpack config build
This commit is contained in:
@ -4,11 +4,12 @@
|
|||||||
"description": "Generate .docx documents with JavaScript (formerly Office-Clippy)",
|
"description": "Generate .docx documents with JavaScript (formerly Office-Clippy)",
|
||||||
"main": "build/index.js",
|
"main": "build/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"pretest": "rimraf ./build-tests && tsc -p src/test-tsconfig.json",
|
"pretest": "rimraf ./build-tests && tsc -p ./test-tsconfig.json",
|
||||||
"test": "mocha ./build-tests --recursive",
|
"test": "mocha ./build-tests --recursive",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"lint": "tslint --project ./src",
|
"lint": "tslint --project .",
|
||||||
"build": "rimraf ./build && tsc -p src",
|
"build": "npm run tsc",
|
||||||
|
"tsc": "rimraf ./build && tsc -p .",
|
||||||
"webpack": "rimraf ./build && webpack",
|
"webpack": "rimraf ./build && webpack",
|
||||||
"demo": "npm run build && node ./demo",
|
"demo": "npm run build && node ./demo",
|
||||||
"typedoc": "typedoc --out docs/ src/ --module commonjs --target ES6 --disableOutputCheck"
|
"typedoc": "typedoc --out docs/ src/ --module commonjs --target ES6 --disableOutputCheck"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export class Utility {
|
export class Utility {
|
||||||
|
// tslint:disable-next-line:no-any
|
||||||
public static jsonify(obj: object): any {
|
public static jsonify(obj: object): any {
|
||||||
const stringifiedJson = JSON.stringify(obj);
|
const stringifiedJson = JSON.stringify(obj);
|
||||||
return JSON.parse(stringifiedJson);
|
return JSON.parse(stringifiedJson);
|
||||||
|
@ -5,14 +5,17 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"preserveConstEnums": true,
|
"preserveConstEnums": true,
|
||||||
"outDir": "../build-tests",
|
"outDir": "./build-tests",
|
||||||
"sourceRoot": "./",
|
"sourceRoot": "./src",
|
||||||
"rootDir": "./",
|
"rootDir": "./src",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"noUnusedLocals": true
|
"noUnusedLocals": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
"**/*.d.ts"
|
"**/*.d.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -5,13 +5,13 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"preserveConstEnums": true,
|
"preserveConstEnums": true,
|
||||||
"outDir": "../build",
|
"outDir": "./build",
|
||||||
"sourceRoot": "./",
|
"sourceRoot": "./src",
|
||||||
"rootDir": "./",
|
"rootDir": "./src",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"baseUrl": "./",
|
"baseUrl": "./src",
|
||||||
"paths" : {
|
"paths" : {
|
||||||
"/*": [
|
"/*": [
|
||||||
"./*"
|
"./*"
|
||||||
@ -19,6 +19,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
"tests",
|
"tests",
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
"**/_*"
|
"**/_*"
|
@ -1,31 +1,25 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { TsConfigPathsPlugin } = require('awesome-typescript-loader');
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './src/index.ts',
|
entry: './src/index.ts',
|
||||||
|
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve('build'),
|
path: path.resolve('build'),
|
||||||
filename: 'bundle.js'
|
filename: 'index.js'
|
||||||
},
|
},
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.ts', '.tsx', '.js'],
|
extensions: ['.tsx', '.ts', '.js']
|
||||||
plugins: [
|
|
||||||
new TsConfigPathsPlugin(/* { configFileName, compiler } */)
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Source maps support ('inline-source-map' also works)
|
|
||||||
devtool: 'source-map',
|
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.ts|\.tsx$/,
|
test: /\.ts$/,
|
||||||
loader: 'awesome-typescript-loader',
|
loaders: ["awesome-typescript-loader"],
|
||||||
exclude: [/^(?!.*\.spec\.ts$).*\.ts$/]
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
target: 'node'
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user