mirror of
https://github.com/kamranahmedse/driver.js.git
synced 2026-11-03 06:23:56 +08:00
Add dev and production webpack config
This commit is contained in:
@@ -50,5 +50,5 @@ module.exports = {
|
||||
stats: {
|
||||
colors: true,
|
||||
},
|
||||
devtool: 'source-map',
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
const path = require('path');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
entry: [
|
||||
'./assets/scripts/src/sholo.js',
|
||||
'./assets/styles/scss/sholo.scss',
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, '/assets'),
|
||||
publicPath: '/assets/',
|
||||
filename: 'scripts/dist/sholo.min.js',
|
||||
libraryTarget: 'umd',
|
||||
library: 'Sholo',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'eslint-loader',
|
||||
enforce: 'pre',
|
||||
options: {
|
||||
failOnWarning: false,
|
||||
failOnError: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['env'],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /.scss$/,
|
||||
loader: ExtractTextPlugin.extract([
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: { minimize: true },
|
||||
},
|
||||
'sass-loader',
|
||||
]),
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin({
|
||||
filename: 'styles/css/sholo.min.css',
|
||||
allChunks: true,
|
||||
}),
|
||||
],
|
||||
stats: {
|
||||
colors: true,
|
||||
},
|
||||
devtool: 'cheap-module-source-map',
|
||||
};
|
||||
Reference in New Issue
Block a user