mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-22 17:56:43 +02:00
Webpack compile less to css
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import path from 'path'
|
||||
import nodeExternals from 'webpack-node-externals'
|
||||
import ExtractTextPlugin from 'extract-text-webpack-plugin'
|
||||
|
||||
export const webConfig = () => {
|
||||
return {
|
||||
@@ -70,3 +71,40 @@ export const nodeConfig = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const lessConfig = () => {
|
||||
return {
|
||||
target: 'web',
|
||||
entry: {
|
||||
'mermaid': './src/less/default/mermaid.less',
|
||||
'mermaid.dark': './src/less/dark/mermaid.less',
|
||||
'mermaid.forest': './src/less/forest/mermaid.less',
|
||||
'mermaid.neutral': './src/less/neutral/mermaid.less'
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, './dist/'),
|
||||
filename: '[name].css'
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.less$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: [
|
||||
{
|
||||
loader: 'css-loader'
|
||||
},
|
||||
{
|
||||
loader: 'less-loader'
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin('[name].css')
|
||||
]
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user