mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-06 13:02:23 -07:00
Updates to UI, Update NLog to 4.4.12
This commit is contained in:
parent
31db4e2026
commit
c8ed46850a
88 changed files with 9550 additions and 269 deletions
|
@ -1,14 +1,9 @@
|
|||
const _ = require('lodash');
|
||||
const gulp = require('gulp');
|
||||
const simpleVars = require('postcss-simple-vars');
|
||||
const nested = require('postcss-nested');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const webpackStream = require('webpack-stream');
|
||||
const livereload = require('gulp-livereload');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const errorHandler = require('./helpers/errorHandler');
|
||||
const reload = require('require-nocache')(module);
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
const uiFolder = 'UI';
|
||||
|
@ -18,13 +13,20 @@ const isProduction = process.argv.indexOf('--production') > -1;
|
|||
console.log('ROOT:', root);
|
||||
console.log('isProduction:', isProduction);
|
||||
|
||||
const cssVariables = [
|
||||
const cssVarsFiles = [
|
||||
'../src/Styles/Variables/colors',
|
||||
'../src/Styles/Variables/dimensions',
|
||||
'../src/Styles/Variables/fonts',
|
||||
'../src/Styles/Variables/animations'
|
||||
].map(require.resolve);
|
||||
|
||||
const extractCSSPlugin = new ExtractTextPlugin({
|
||||
filename: path.join('_output', uiFolder, 'Content', 'styles.css'),
|
||||
allChunks: true,
|
||||
disable: false,
|
||||
ignoreOrder: true
|
||||
});
|
||||
|
||||
const config = {
|
||||
devtool: '#source-map',
|
||||
stats: {
|
||||
|
@ -39,9 +41,10 @@ const config = {
|
|||
index: 'index.js'
|
||||
},
|
||||
resolve: {
|
||||
root: [
|
||||
modules: [
|
||||
root,
|
||||
path.join(root, 'Shims')
|
||||
path.join(root, 'Shims'),
|
||||
'node_modules'
|
||||
],
|
||||
alias: {
|
||||
jquery: 'jquery/src/jquery'
|
||||
|
@ -52,10 +55,11 @@ const config = {
|
|||
sourceMapFilename: '[file].map'
|
||||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin(path.join('_output', uiFolder, 'Content', 'styles.css'), { allChunks: true }),
|
||||
extractCSSPlugin,
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor'
|
||||
}),
|
||||
|
||||
new webpack.DefinePlugin({
|
||||
__DEV__: !isProduction,
|
||||
'process.env': {
|
||||
|
@ -64,22 +68,23 @@ const config = {
|
|||
})
|
||||
],
|
||||
resolveLoader: {
|
||||
modulesDirectories: [
|
||||
modules: [
|
||||
'node_modules',
|
||||
'gulp/webpack/'
|
||||
'frontend/gulp/webpack/'
|
||||
]
|
||||
},
|
||||
eslint: {
|
||||
formatter: function(results) {
|
||||
return JSON.stringify(results);
|
||||
}
|
||||
},
|
||||
// TODO: Do we need this loader?
|
||||
// eslint: {
|
||||
// formatter: function(results) {
|
||||
// return JSON.stringify(results);
|
||||
// }
|
||||
// },
|
||||
module: {
|
||||
loaders: [
|
||||
rules: [
|
||||
{
|
||||
test: /\.js?$/,
|
||||
exclude: /(node_modules|JsLibraries)/,
|
||||
loader: 'babel',
|
||||
loader: 'babel-loader',
|
||||
query: {
|
||||
plugins: ['transform-class-properties'],
|
||||
presets: ['es2015', 'decorators-legacy', 'react', 'stage-2'],
|
||||
|
@ -95,51 +100,80 @@ const config = {
|
|||
{
|
||||
test: /\.css$/,
|
||||
exclude: /(node_modules|globals.css)/,
|
||||
loader: ExtractTextPlugin.extract('style', 'css-loader?modules&importLoaders=1&sourceMap&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader')
|
||||
use: extractCSSPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: [
|
||||
{
|
||||
loader: 'css-variables-loader',
|
||||
options: {
|
||||
cssVarsFiles
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
modules: true,
|
||||
importLoaders: 1,
|
||||
localIdentName: '[name]-[local]-[hash:base64:5]',
|
||||
sourceMap: true
|
||||
}
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
config: {
|
||||
ctx: {
|
||||
cssVarsFiles
|
||||
},
|
||||
path: 'frontend/postcss.config.js'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
|
||||
// Global styles
|
||||
{
|
||||
test: /\.css$/,
|
||||
include: /(node_modules|globals.css)/,
|
||||
loader: 'style!css-loader'
|
||||
use: [
|
||||
'style-loader',
|
||||
{
|
||||
loader: 'css-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// Fonts
|
||||
{
|
||||
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
||||
loader: 'url?limit=10240&mimetype=application/font-woff&emitFile=false&name=Content/Fonts/[name].[ext]'
|
||||
use: [
|
||||
{
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10240,
|
||||
mimetype: 'application/font-woff',
|
||||
emitFile: false,
|
||||
name: 'Content/Fonts/[name].[ext]'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
test: /\.(ttf|eot|eot?#iefix|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
||||
loader: 'file-loader?emitFile=false&name=Content/Fonts/[name].[ext]'
|
||||
use: [
|
||||
{
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
emitFile: false,
|
||||
name: 'Content/Fonts/[name].[ext]'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
postcss: function(wpack) {
|
||||
cssVariables.forEach(wpack.addDependency);
|
||||
|
||||
return [
|
||||
simpleVars({
|
||||
variables: function() {
|
||||
return cssVariables.reduce(function(obj, vars) {
|
||||
return _.extend(obj, reload(vars));
|
||||
}, {});
|
||||
}
|
||||
}),
|
||||
nested(),
|
||||
autoprefixer({
|
||||
browsers: [
|
||||
'Chrome >= 30',
|
||||
'Firefox >= 30',
|
||||
'Safari >= 6',
|
||||
'Edge >= 12',
|
||||
'Explorer >= 10',
|
||||
'iOS >= 7',
|
||||
'Android >= 4.4'
|
||||
]
|
||||
})
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
11
frontend/gulp/webpack/css-variables-loader.js
Normal file
11
frontend/gulp/webpack/css-variables-loader.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
const loaderUtils = require('loader-utils');
|
||||
|
||||
module.exports = function cssVariablesLoader(source) {
|
||||
const options = loaderUtils.getOptions(this);
|
||||
|
||||
options.cssVarsFiles.forEach((cssVarsFile) => {
|
||||
this.addDependency(cssVarsFile);
|
||||
});
|
||||
|
||||
return source;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue