mirror of https://github.com/grafana/grafana
Webpack 4 (WIP) (#12098)
* Webpack 4 * webpack: force angular version 1.6 as 1.7 has removed a legacy feature toggle Grafana needs, switched from awesome-typescript-loader to ts-loader & forked ts checker * Webpack 4 * webpack: force angular version 1.6 as 1.7 has removed a legacy feature toggle Grafana needs, switched from awesome-typescript-loader to ts-loader & forked ts checker * upgrade ts loader * simplified splitChunks * upgrade circle node image to v8 * webpack: minor changes, using the new mode option, removed unused awesome-typescript loader, investigating karma issue but no solution yet * fix: change angular mocks version restriction to be more strict * add babel-loader for HMR support, fix karma debug runner * babel-loader to yarn.lock * webpack: changed from ExtractTextPlugin to MiniCssExtractPlugin, and updated the minification step to use new webpack4 optimization config section * webpack: remove css minifcation from general css processing as it's done in the webpack optimization step * limit vendors chunk to .ts and .js files * fix: removed typescript compile error, wanted to see if we still got test failure for that * tech: upgrade uglify-js, should be faster nowpull/12412/head
parent
f83306bb5b
commit
713a87fb5b
@ -1,37 +1,29 @@ |
|||||||
'use strict'; |
'use strict'; |
||||||
|
|
||||||
const ExtractTextPlugin = require("extract-text-webpack-plugin"); |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); |
||||||
|
|
||||||
module.exports = function (options, extractSass) { |
module.exports = function(options) { |
||||||
return { |
return { |
||||||
test: /\.scss$/, |
test: /\.scss$/, |
||||||
use: (extractSass || ExtractTextPlugin).extract({ |
use: [ |
||||||
use: [ |
MiniCssExtractPlugin.loader, |
||||||
{ |
{ |
||||||
loader: 'css-loader', |
loader: 'css-loader', |
||||||
options: { |
options: { |
||||||
importLoaders: 2, |
importLoaders: 2, |
||||||
url: options.preserveUrl, |
url: options.preserveUrl, |
||||||
sourceMap: options.sourceMap, |
sourceMap: options.sourceMap, |
||||||
minimize: options.minimize, |
minimize: options.minimize, |
||||||
} |
|
||||||
}, |
|
||||||
{ |
|
||||||
loader: 'postcss-loader', |
|
||||||
options: { |
|
||||||
sourceMap: options.sourceMap, |
|
||||||
config: { path: __dirname + '/postcss.config.js' } |
|
||||||
} |
|
||||||
}, |
}, |
||||||
{ loader: 'sass-loader', options: { sourceMap: options.sourceMap } } |
}, |
||||||
], |
{ |
||||||
fallback: [{ |
loader: 'postcss-loader', |
||||||
loader: 'style-loader', |
|
||||||
options: { |
options: { |
||||||
sourceMap: true |
sourceMap: options.sourceMap, |
||||||
} |
config: { path: __dirname + '/postcss.config.js' }, |
||||||
}] |
}, |
||||||
}) |
}, |
||||||
|
{ loader: 'sass-loader', options: { sourceMap: options.sourceMap } }, |
||||||
|
], |
||||||
}; |
}; |
||||||
} |
}; |
||||||
|
|
||||||
|
Loading…
Reference in new issue