Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
笔记:Webpack 输出 UMD,extract-text-plugin 删除部分内容导致输出为空 - 8. 导致问题发生的 webpack 完整配置
var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
moda: [
'./src/moda.js',
'./src/moda.scss'
]
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
library: 'moda',
libraryTarget: 'umd',
},
module: {
rules: [
{
test: /.\css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: ['css-loader', 'sass-loader'],
fallback: 'style-loader'
})
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
},
plugins: [
new ExtractTextPlugin('moda.css')
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.