1 Star 0 Fork 1

BigBao / danmu.js

forked from Bytedance Inc. / danmu.js 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.js 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
/* eslint-env node */
const webpack = require('webpack')
const { merge } = require('webpack-merge')
const argv = require('yargs').argv
const { version } = require('./package.json')
const commonConfig = {
entry: './src/index.js',
devtool: 'source-map',
mode: 'production',
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
presets: ['es2015'],
plugins: ['add-module-exports', 'babel-plugin-bulk-import']
}
},
{
test: /\.scss$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1,
minimize: true
}
},
'postcss-loader',
'sass-loader'
]
}
]
},
plugins: [
new webpack.DefinePlugin({
__VERSION__: JSON.stringify(version)
}),
new webpack.BannerPlugin('Built @' + new Date().toUTCString())
// new BundleAnalyzerPlugin()
],
optimization: {
minimize: !argv.watch
}
}
const umd = merge(commonConfig, {
output: {
path: `${__dirname}/dist`,
filename: 'index.js',
library: 'danmu.js',
libraryTarget: 'umd'
}
})
const client = merge(commonConfig, {
output: {
path: `${__dirname}/browser`,
filename: 'index.js',
library: 'DanmuJs',
libraryTarget: 'window'
}
})
module.exports = [umd, client]
1
https://gitee.com/gfsmxn/danmu.js.git
git@gitee.com:gfsmxn/danmu.js.git
gfsmxn
danmu.js
danmu.js
main

搜索帮助