UNPKG

sanyuelanv-turntable

Version:

优化转盘转动效果 1. 缓动加速转动, 2. 均速转动 **(在没有接收到结果的时候一直均速转动)** 3. **(接受到结果)** 缓动减速转动直到停止

46 lines (45 loc) 1.18 kB
const commonConfig = require('./webpack.common.config') const webpackMerge = require('webpack-merge') const path = require('path') const webpack = require('webpack') const process = require('process') const HtmlWebpackPlugin = require('html-webpack-plugin') const nodeModuleDir = path.resolve(process.cwd(), 'node_module') const ip = require('ip') const port = 8080 const host = ip.address() const appDir = path.resolve(process.cwd(), 'app') const config = webpackMerge(commonConfig, { mode: 'development', devServer: { contentBase: path.resolve(process.cwd(), 'build'), compress: true, port, host, }, devtool: 'inline-source-map', plugins: [ new webpack.HotModuleReplacementPlugin(), new HtmlWebpackPlugin({ filename: `index.html`, title: 'demo', template: path.join(appDir, 'app.html'), inject: true, chunks: ['app'] }) ], module: { rules: [ { test: /\.(png|svg|jpg|gif)$/, use: [{ loader: 'url-loader', // file-loader options: { limit: 2500 } }], include: [appDir], exclude: [nodeModuleDir] } ] } }) module.exports = config