Update target for library

This commit is contained in:
Dolan
2018-08-15 01:38:00 +01:00
parent 07261232ff
commit f969c866a7
2 changed files with 10 additions and 45 deletions

View File

@ -1,17 +1,17 @@
const path = require('path'); const path = require("path");
module.exports = { module.exports = {
entry: './src/index.ts', entry: "./src/index.ts",
output: { output: {
path: path.resolve('build'), path: path.resolve("build"),
filename: 'index.js', filename: "index.js",
libraryTarget: 'umd' libraryTarget: "umd",
}, },
resolve: { resolve: {
extensions: ['.tsx', '.ts', '.js'], extensions: [".tsx", ".ts", ".js"],
modules: [path.resolve('./src'), "node_modules"] modules: [path.resolve("./src"), "node_modules"],
}, },
module: { module: {
@ -19,13 +19,10 @@ module.exports = {
{ {
test: /\.ts$/, test: /\.ts$/,
loaders: ["awesome-typescript-loader"], loaders: ["awesome-typescript-loader"],
} },
], ],
}, },
target: 'node', // Because docx is now targetting web
// target: 'node',
node: {
__dirname: true
}
}; };

View File

@ -1,32 +0,0 @@
const path = require('path');
module.exports = {
entry: './src/index.ts',
output: {
path: path.resolve('build'),
filename: 'index.web.js',
libraryTarget: 'umd'
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
modules: [path.resolve('./src'), "node_modules"]
},
module: {
rules: [
{
test: /\.ts$/,
loaders: ["awesome-typescript-loader"],
}
],
},
node: {
__dirname: true,
fs: "empty",
tls: "empty",
net: "empty"
}
};