mermaid/webpack.config.e2e.js
dependabot[bot] 61d16b682b
Bump webpack-dev-server from 3.11.2 to 4.2.1 (#2323)
* Bump webpack-dev-server from 3.11.2 to 4.2.1

Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.11.2 to 4.2.1.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v3.11.2...v4.2.1)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
2021-09-20 23:19:22 +02:00

69 lines
1.4 KiB
JavaScript

const path = require('path');
const jsRule = {
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
};
const jisonRule = {
test: /\.jison$/,
use: {
loader: path.resolve(__dirname, './jisonLoader'),
options: {
'token-stack': true,
},
},
};
const amdRule = {
parser: {
amd: false, // https://github.com/lodash/lodash/issues/3052
},
};
const scssRule = {
// load scss to string
test: /\.scss$/,
use: [{ loader: 'css-to-string-loader' }, { loader: 'css-loader' }, { loader: 'sass-loader' }],
};
module.exports = {
mode: 'development',
target: 'web',
entry: {
mermaid: './src/mermaid.js',
e2e: './cypress/platform/viewer.js',
'bundle-test': './cypress/platform/bundle-test.js',
},
resolve: {
extensions: ['.wasm', '.mjs', '.js', '.json', '.jison'],
},
node: {
fs: 'empty', // jison generated code requires 'fs'
},
output: {
path: path.join(__dirname, './dist/'),
filename: '[name].js',
library: 'mermaid',
libraryTarget: 'umd',
libraryExport: 'default',
},
devServer: {
compress: true,
port: 9000,
static: [
{ directory: path.join(__dirname, 'cypress', 'platform') },
{ directory: path.join(__dirname, 'dist') },
],
},
module: {
rules: [amdRule, jsRule, scssRule, jisonRule],
},
externals: {
mermaid: 'mermaid',
},
devtool: 'source-map',
};