mermaid-webpack-demo
mermaid-webpack-demo copied to clipboard
Does not work with webpack in "Production" mode, with uglify.
Hi, I am having problems with Mermaid and Webpack in my project, so I decided to use this repo as a test.
I cloned the repo and ran the npm build script, which worked without any trouble.
I then modified the build script in the package.config file to more closely match the one I am using in my project. I used "build": "webpack --progress --colors -p"
I then tried to run the build script again, and it did not work. The error I am getting is
ERROR in index.bundle.js from UglifyJs
Unexpected token: name (v) [index.bundle.js:22759,6]
UglifyJS doesn't support ES6. So this is actually a general issue in JS world, not closely related to mermaid.
Cool, I managed to use Bable instead of Ugligy.
@tylerlong should I close this issue?
Would you mind sharing how you did it? I'm not a webpack expert but experiencing this issue as well.
I am also not a webpack export, my config is hacked together using bits I could figure out online.
in my webpack file under module.exports={} I have
module: {
loaders: [
{
test: /\.tsx?$/,
loaders: ['babel-loader', 'awesome-typescript-loader'],
exclude: [/node_modules/]
},
// ... more loaders are here.
]
},
There will be dependencies that will be needed, i.e. npm install --save-dev babel loader