aboutsummaryrefslogtreecommitdiffstats
path: root/dox-sequence-diagram-ui/webpack.config.js
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-02-19 12:57:33 +0200
committerMichael Lando <ml636r@att.com>2017-02-19 13:47:13 +0200
commitefa037d34be7b1570efdc767c79fad8d4005f10e (patch)
treecf1036ba2728dea8a61492b678fa91954e629403 /dox-sequence-diagram-ui/webpack.config.js
parentf5f13c4f6b6fe3b4d98e349dfd7db59339803436 (diff)
Add new code new version
Change-Id: Ic02a76313503b526f17c3df29eb387a29fe6a42a Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'dox-sequence-diagram-ui/webpack.config.js')
-rw-r--r--dox-sequence-diagram-ui/webpack.config.js99
1 files changed, 99 insertions, 0 deletions
diff --git a/dox-sequence-diagram-ui/webpack.config.js b/dox-sequence-diagram-ui/webpack.config.js
new file mode 100644
index 0000000000..7b7f4b948c
--- /dev/null
+++ b/dox-sequence-diagram-ui/webpack.config.js
@@ -0,0 +1,99 @@
+var webpack = require('webpack');
+var path = require('path');
+
+var PATHS = {
+ SRC: path.resolve(__dirname, 'src/main/webapp'),
+ TARGET: path.resolve(__dirname, 'dist')
+};
+
+var devmode = (process.env.npm_lifecycle_event === 'start');
+
+var entry = [];
+if (devmode) {
+ entry.push('babel-polyfill');
+ entry.push(path.resolve(PATHS.SRC, 'lib/main.jsx'));
+} else {
+ entry.push(path.resolve(PATHS.SRC, 'lib/ecomp/asdc/sequencer/Sequencer.jsx'));
+}
+
+var config = {
+ entry: entry,
+ output: {
+ path: PATHS.TARGET,
+ filename: 'index.js',
+ libraryTarget: 'umd'
+ },
+ resolve: {
+ extensions: ['', '.js', '.jsx']
+ },
+ eslint: {
+ failOnWarning: false,
+ failOnError: true,
+ configFile: 'eslintrc.json'
+ },
+ devtool: 'eval-source-map',
+ module: {
+ preLoaders: [{
+ test: /\.(js|jsx)?$/,
+ loader: 'eslint-loader',
+ exclude: /node_modules/
+ }],
+ loaders: [{
+ test: /\.(js|jsx)$/,
+ include: path.join(PATHS.SRC, 'lib'),
+ loader: 'babel-loader',
+ exclude: /node_modules/,
+ query: {
+ presets: ['es2015', 'react']
+ }
+ }, {
+ test: /\.css$/,
+ loaders: ['style', 'css']
+ }, {
+ test: /\.(png|woff|woff2|eot|ttf|otf)$/,
+ loader: 'url-loader?limit=100000'
+ }, {
+ test: /\.scss$/,
+ include: path.join(PATHS.SRC, 'res'),
+ loaders: ['style', 'css', 'sass']
+ }, {
+ test: /\.html$/,
+ include: path.join(PATHS.SRC, 'lib'),
+ loaders: ['raw']
+ }, {
+ test: /\.json$/,
+ include: path.join(PATHS.SRC, 'lib'),
+ loaders: ['json']
+ }, {
+ test: /\.svg$/,
+ loader: 'svg-sprite?' + JSON.stringify({
+ name: '[name]_[hash]',
+ prefixize: true
+ })
+ }]
+ },
+ externals: (devmode ? {} : {
+ 'd3': 'd3',
+ 'lodash': 'lodash',
+ 'react': 'react',
+ 'react-dnd': 'react-dnd',
+ 'react-dnd-html5-backend': 'react-dnd-html5-backend',
+ 'react-dom': 'react-dom',
+ 'react-redux': 'react-redux',
+ 'react-select': 'react-select',
+ 'redux': 'redux'
+ }),
+ devServer: {
+ port: 4096,
+ quiet: false,
+ contentBase: 'src/main/webapp',
+ proxy: {
+ '/services/*': {
+ target: 'http://localhost:38080/asdc-sequencer',
+ secure: false
+ }
+ }
+ }
+};
+
+module.exports = config;