2018-12-09 21:58:18 +01:00
|
|
|
const path = require('path');
|
2018-12-09 21:42:17 +01:00
|
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
|
|
2017-11-28 21:43:25 +01:00
|
|
|
module.exports = {
|
2017-11-28 22:21:35 +01:00
|
|
|
entry: {
|
|
|
|
infoscreens: './index.js',
|
2017-11-29 15:02:35 +01:00
|
|
|
infodisplay: './infodisplay/infodisplay.js',
|
2017-12-01 16:29:50 +01:00
|
|
|
calendar: './events/calendar.js',
|
2018-12-24 15:18:35 +01:00
|
|
|
'35c3-calendar': './35c3-events/calendar.js',
|
2017-11-28 22:21:35 +01:00
|
|
|
},
|
2017-11-28 21:43:25 +01:00
|
|
|
output: {
|
2018-12-09 21:58:18 +01:00
|
|
|
path: path.resolve(__dirname, 'dist'),
|
|
|
|
filename: 'lib/[name].js',
|
2017-11-28 22:21:35 +01:00
|
|
|
library: '[name]',
|
|
|
|
libraryTarget: 'umd',
|
2017-11-28 21:43:25 +01:00
|
|
|
},
|
2018-12-09 21:58:18 +01:00
|
|
|
mode: 'production',
|
2017-11-28 21:43:25 +01:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
2017-11-28 22:21:35 +01:00
|
|
|
exclude: /paho.mqtt.js/,
|
2017-11-28 21:43:25 +01:00
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: ['@babel/preset-env'],
|
|
|
|
plugins: ['transform-class-properties'],
|
2018-12-09 21:42:17 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2017-11-28 22:21:35 +01:00
|
|
|
},
|
2018-12-09 21:42:17 +01:00
|
|
|
plugins: [
|
|
|
|
new CopyWebpackPlugin([
|
|
|
|
{
|
|
|
|
from: '**/index.html',
|
2018-12-09 21:58:18 +01:00
|
|
|
to: './',
|
2018-12-15 19:44:20 +01:00
|
|
|
ignore: ['node_modules/**/*.html'],
|
2018-12-09 21:42:17 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
from: '**/*.svg',
|
2018-12-09 21:58:18 +01:00
|
|
|
to: './',
|
2018-12-15 19:44:20 +01:00
|
|
|
ignore: ['node_modules/**/*.svg'],
|
2018-12-09 21:42:17 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
from: 'theme/*',
|
2018-12-09 21:58:18 +01:00
|
|
|
to: './',
|
2018-12-09 21:42:17 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
from: 'node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js',
|
2018-12-09 21:58:18 +01:00
|
|
|
to: './vendor/webcomponentsjs/webcomponents-lite.js',
|
2018-12-09 21:42:17 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
from: 'node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js',
|
2018-12-09 21:58:18 +01:00
|
|
|
to: './vendor/webcomponentsjs/custom-elements-es5-adapter.js',
|
2018-12-09 21:42:17 +01:00
|
|
|
},
|
|
|
|
{
|
2024-10-19 06:10:43 +02:00
|
|
|
from: 'plotly-workaround-for-firefox/plotly.min.js',
|
2018-12-09 21:58:18 +01:00
|
|
|
to: './vendor/plotly.js/plotly.min.js',
|
2018-12-09 21:42:17 +01:00
|
|
|
},
|
|
|
|
]),
|
|
|
|
],
|
2017-11-28 22:21:35 +01:00
|
|
|
externals: {
|
|
|
|
newrelic: 'commonjs newrelic',
|
|
|
|
tv4: 'commonjs tv4',
|
|
|
|
'ampqlib/callback_api': 'commonjs ampqlib/callback_api',
|
|
|
|
mqtt: 'commonjs mqtt',
|
|
|
|
},
|
|
|
|
node: {
|
|
|
|
fs: 'empty',
|
|
|
|
},
|
2018-12-09 21:58:18 +01:00
|
|
|
devServer: {
|
|
|
|
host: process.env.HOST || 'localhost',
|
|
|
|
port: 3000,
|
|
|
|
inline: true,
|
|
|
|
},
|
2017-11-28 21:43:25 +01:00
|
|
|
};
|