mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
cc5d7002b0
* adds `npm start` / `yarn start` script * starts a webpack-dev-server using the dev config, served on :3333 * hot reloading (HMR) for react/styles, not working for angular code * new entry `dev.ts` for dynamic imports of CSS theme (ExtractText does not work with HMR) * TS loader pipeline moved out of common to add HMR for react * applied `hot()` to some react containers (that's their new default export, named exports remains for testing) * added sections to README * updated yarn.lock
66 lines
1.3 KiB
JavaScript
66 lines
1.3 KiB
JavaScript
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].[hash].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: require.resolve('jquery'),
|
|
use: [
|
|
{
|
|
loader: 'expose-loader',
|
|
query: 'jQuery'
|
|
},
|
|
{
|
|
loader: 'expose-loader',
|
|
query: '$'
|
|
}
|
|
]
|
|
},
|
|
{
|
|
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(),
|
|
]
|
|
};
|