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