mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-02 15:16:49 +02:00
No manual global mermaid
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import path from 'path'
|
||||
import nodeExternals from 'webpack-node-externals'
|
||||
import ExtractTextPlugin from 'extract-text-webpack-plugin'
|
||||
|
||||
const rules = [
|
||||
@@ -11,7 +10,7 @@ const rules = [
|
||||
}
|
||||
]
|
||||
|
||||
export const webConfig = () => {
|
||||
export const jsConfig = () => {
|
||||
return {
|
||||
target: 'web',
|
||||
entry: {
|
||||
@@ -20,7 +19,10 @@ export const webConfig = () => {
|
||||
externals: ['fs'],
|
||||
output: {
|
||||
path: path.join(__dirname, './dist/'),
|
||||
filename: '[name].js'
|
||||
filename: '[name].js',
|
||||
library: 'mermaid',
|
||||
libraryTarget: 'umd',
|
||||
libraryExport: 'default'
|
||||
},
|
||||
module: {
|
||||
rules: rules.concat([
|
||||
@@ -46,41 +48,6 @@ export const webConfig = () => {
|
||||
}
|
||||
}
|
||||
|
||||
export const nodeConfig = () => {
|
||||
return {
|
||||
target: 'node',
|
||||
entry: {
|
||||
mermaidAPI: './src/mermaidAPI.js'
|
||||
},
|
||||
externals: [nodeExternals()],
|
||||
output: {
|
||||
path: path.join(__dirname, './dist/'),
|
||||
filename: '[name].js',
|
||||
libraryTarget: 'commonjs2'
|
||||
},
|
||||
module: {
|
||||
rules: rules.concat([
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: [
|
||||
['env', {
|
||||
'targets': {
|
||||
'node': '6.9'
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const lessConfig = () => {
|
||||
return {
|
||||
target: 'web',
|
||||
|
Reference in New Issue
Block a user