mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 11:32:36 +08:00
Webpack (#9391)
* webpack poc, this is not going to work for plugins, dam * tech: webpack and systemjs for plugins starting to work * tech: webpack and systemjs combo starting to work * tech: webpack + karma tests progress * tech: webpack + karma progress * tech: working on tests * tech: webpack * tech: webpack + karma, all tests pass * tech: webpack + karma, all tests pass * tech: webpack all tests pass * webpack: getting closer * tech: webpack progress * webpack: further build refinements * webpack: ng annotate fixes * webpack: optimized build fix * tech: minor fix for elasticsearch * tech: webpack + ace editor * tech: restored lodash move mixin compatability * tech: added enzyme react test and upgraded to react v16 * tech: package version fix * tech: added testdata to built in bundle * webpack: sass progress * tech: prod & dev build is working for the sass * tech: clean up unused grunt stuff and moved to scripts folder * tech: added vendor and manifest chunks, updated readme and docs * tech: webpack finishing touches
This commit is contained in:
87
scripts/webpack/webpack.common.js
Normal file
87
scripts/webpack/webpack.common.js
Normal file
@ -0,0 +1,87 @@
|
||||
const path = require('path');
|
||||
const {CheckerPlugin} = require('awesome-typescript-loader')
|
||||
|
||||
module.exports = {
|
||||
target: 'web',
|
||||
stats: {
|
||||
children: false
|
||||
},
|
||||
entry: {
|
||||
app: './public/app/index.ts',
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../../public/build'),
|
||||
filename: '[name].[chunkhash].js',
|
||||
publicPath: "public/build/",
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.es6', '.js', '.json'],
|
||||
alias: {
|
||||
},
|
||||
modules: [
|
||||
path.resolve('public'),
|
||||
path.resolve('node_modules')
|
||||
],
|
||||
},
|
||||
node: {
|
||||
fs: 'empty',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(ts|tsx)$/,
|
||||
enforce: 'pre',
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
emitErrors: true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{ loader: "awesome-typescript-loader" }
|
||||
]
|
||||
},
|
||||
{
|
||||
test: require.resolve('jquery'),
|
||||
use: [
|
||||
{
|
||||
loader: 'expose-loader',
|
||||
query: 'jQuery'
|
||||
},
|
||||
{
|
||||
loader: 'expose-loader',
|
||||
query: '$'
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// test : /\.(ico|png|cur|jpg|ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
|
||||
// loader : 'file-loader',
|
||||
// },
|
||||
{
|
||||
test: /\.html$/,
|
||||
exclude: /index\.template.html/,
|
||||
use: [
|
||||
{ loader:'ngtemplate-loader?relativeTo=' + (path.resolve(__dirname, '../../public')) + '&prefix=public'},
|
||||
{
|
||||
loader: 'html-loader',
|
||||
options: {
|
||||
attrs: [],
|
||||
minimize: true,
|
||||
removeComments: false,
|
||||
collapseWhitespace: false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new CheckerPlugin(),
|
||||
]
|
||||
};
|
Reference in New Issue
Block a user