Move from miccall theme to kaze
This commit is contained in:
100
aplayer/webpack/prod.config.js
Normal file
100
aplayer/webpack/prod.config.js
Normal file
@@ -0,0 +1,100 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const GitRevisionPlugin = require('git-revision-webpack-plugin');
|
||||
const gitRevisionPlugin = new GitRevisionPlugin();
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const cssnano = require('cssnano');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
|
||||
bail: true,
|
||||
|
||||
devtool: 'source-map',
|
||||
|
||||
entry: {
|
||||
APlayer: './src/js/index.js',
|
||||
},
|
||||
|
||||
output: {
|
||||
path: path.resolve(__dirname, '..', 'dist'),
|
||||
filename: '[name].min.js',
|
||||
library: '[name]',
|
||||
libraryTarget: 'umd',
|
||||
libraryExport: 'default',
|
||||
umdNamedDefine: true,
|
||||
publicPath: '/',
|
||||
},
|
||||
|
||||
resolve: {
|
||||
modules: ['node_modules'],
|
||||
extensions: ['.js', '.scss'],
|
||||
},
|
||||
|
||||
module: {
|
||||
strictExportPresence: true,
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: [
|
||||
'template-string-optimize-loader',
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
cacheDirectory: true,
|
||||
presets: ['@babel/preset-env'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
importLoaders: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
plugins: [autoprefixer, cssnano],
|
||||
},
|
||||
},
|
||||
'sass-loader',
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpg)$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 40000,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
loader: 'svg-inline-loader',
|
||||
},
|
||||
{
|
||||
test: /\.art$/,
|
||||
loader: 'art-template-loader',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
APLAYER_VERSION: `"${require('../package.json').version}"`,
|
||||
GIT_HASH: JSON.stringify(gitRevisionPlugin.version()),
|
||||
}),
|
||||
],
|
||||
|
||||
node: {
|
||||
dgram: 'empty',
|
||||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty',
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user