markdown-loader-xch
v1.0.0
Published
``` <%= require('./article.md') %> ```
Downloads
5
Readme
使用说明
调用语句
<%= require('./article.md') %>
webpack.config.js文件
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
resolveLoader: {
modules: ['node_modules', 'loaders']
},
entry: {
app: './src/index.js'
},
module: {
rules: [
{
test: /\.md$/,
use: [
{
loader: 'html-loader'
},
{
loader: 'markdown-loader',
options: {}
}
]
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.{png|svg|jpg|gif}$/,
use: [
'file-loader'
]
},
{
test: /\.js$/,
use: [
{
loader: 'replace-loader',
options: {
name: 'abc'
}
}
]
},
{
test: /\.html$/,
use: [
'html-loader'
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/views/index.html'
}),
]
};