mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Adds Webpack support and removes the use for Grunt
Signed-off-by: Thomas Citharel <tcit@tcit.fr> use scss Signed-off-by: Thomas Citharel <tcit@tcit.fr> fix build, add babel, fix annotations fixes (and improvements !) for baggy add live reload & environments & eslint & theme fixes
This commit is contained in:
parent
3b4502e0e6
commit
64f81bc316
197 changed files with 8710 additions and 131004 deletions
99
app/config/webpack/prod.js
Normal file
99
app/config/webpack/prod.js
Normal file
|
@ -0,0 +1,99 @@
|
|||
const webpack = require('webpack');
|
||||
const webpackMerge = require('webpack-merge');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const ManifestPlugin = require('webpack-manifest-plugin');
|
||||
|
||||
const commonConfig = require('./common.js');
|
||||
|
||||
module.exports = function() {
|
||||
return webpackMerge(commonConfig(), {
|
||||
output: {
|
||||
filename: '[name].js'
|
||||
},
|
||||
devtool: 'source-map',
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'NODE_ENV': JSON.stringify('production')
|
||||
}
|
||||
}),
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
beautify: false,
|
||||
mangle: {
|
||||
screw_ie8: true,
|
||||
keep_fnames: true
|
||||
},
|
||||
compress: {
|
||||
screw_ie8: true,
|
||||
warnings: false
|
||||
},
|
||||
comments: false
|
||||
}),
|
||||
new ExtractTextPlugin('[name].css'),
|
||||
new ManifestPlugin({
|
||||
fileName: 'manifest.json',
|
||||
})
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
loader: 'eslint-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /(node_modules)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['env']
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(s)?css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: [
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
importLoaders: 1,
|
||||
minimize: {
|
||||
discardComments: {
|
||||
removeAll: true
|
||||
},
|
||||
core: true,
|
||||
minifyFontValues: true
|
||||
}
|
||||
}
|
||||
},
|
||||
'postcss-loader',
|
||||
'sass-loader'
|
||||
]
|
||||
})
|
||||
},
|
||||
{
|
||||
test: /\.(jpg|png|gif|svg)$/,
|
||||
use: {
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: 'img/[name].[ext]',
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(eot|ttf|woff|woff2)$/,
|
||||
use: {
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: 'fonts/[name].[ext]',
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
})
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue