UNPKG

hierarchy-model

Version:

A data model for a hierarchy of nodes, used by roles-hierarchy and permissions-hierarchy

64 lines (57 loc) 1.25 kB
var path = require('path'); var webpack = require('webpack'); var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin; var env = process.env.WEBPACK_ENV; var libraryName = 'hierarchy'; var plugins = [], outputFile; if (env === 'build') { plugins.push(new UglifyJsPlugin({ minimize: true })); outputFile = libraryName + '.min.js'; } else { outputFile = libraryName + '.js'; } module.exports = { entry: {hierarchy: './source/hierarchy.js', test: './test/test.js'}, devtool: 'source-map', output: { path: path.resolve(__dirname, 'distribution'), filename: '[name].js', library: 'hierarchy-model', libraryTarget: 'umd', umdNamedDefine: true }, module: { rules: [ { test: /\.js$/, exclude: /(node_modules|bower_components)/, use: { loader: 'babel-loader', options: { presets: ['env'] } } } ] }, stats: { colors: true }, node: { fs: "empty" }, externals: { config: { commonjs: 'config', commonjs2: 'config', amd: 'config', root: 'config' }, winston: { commonjs: 'winston', commonjs2: 'winston', amd: 'winston', root: 'winston' } } };