mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 13:52:25 +08:00
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 now
This commit is contained in:
@ -3,29 +3,36 @@ const merge = require('webpack-merge');
|
||||
const common = require('./webpack.common.js');
|
||||
|
||||
config = merge(common, {
|
||||
mode: 'development',
|
||||
devtool: 'cheap-module-source-map',
|
||||
|
||||
externals: {
|
||||
'react/addons': true,
|
||||
'react/lib/ExecutionEnvironment': true,
|
||||
'react/lib/ReactContext': true,
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{ loader: "awesome-typescript-loader" }
|
||||
]
|
||||
use: {
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
transpileOnly: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
],
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.SourceMapDevToolPlugin({
|
||||
filename: null, // if no value is provided the sourcemap is inlined
|
||||
test: /\.(ts|js)($|\?)/i // process .js and .ts files only
|
||||
test: /\.(ts|js)($|\?)/i, // process .js and .ts files only
|
||||
}),
|
||||
]
|
||||
],
|
||||
});
|
||||
|
||||
module.exports = config;
|
||||
|
Reference in New Issue
Block a user