o3-dapi-ont
Version:
Ontology Plugin for o3-dapi
41 lines (38 loc) • 1.03 kB
JavaScript
const path = require('path');
const webpack = require('webpack');
module.exports = (env) => {
const DISTRIBUTION = env && env.DISTRIBUTION === 'true';
return {
resolve: {
extensions: ['.ts', '.js'],
},
entry: ['./src/index'],
module: {
rules: [
{
test: /\.ts$/,
enforce: 'pre',
loader: "tslint-loader",
exclude: [/node_modules/],
include: path.join(__dirname, './src'),
},
{
test: /\.ts$/,
exclude: [/node_modules/],
use: 'ts-loader',
include: path.join(__dirname, './src'),
},
],
},
devtool: !DISTRIBUTION && 'inline-source-map',
output: {
path: path.join(__dirname, DISTRIBUTION ? 'lib' : 'build'),
filename: DISTRIBUTION ? 'o3-dapi-ont.min.js' : 'bundle.js',
libraryTarget: "umd",
library: 'o3dapiOnt',
libraryExport: 'default',
globalObject: 'typeof self !== \'undefined\' ? self : this',
},
};
};