mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add weback-dev-server with hot/hmr support
* 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
This commit is contained in:
@@ -20,8 +20,27 @@ module.exports = merge(common, {
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
enforce: 'pre',
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
typeCheck: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: [
|
||||
{ loader: "awesome-typescript-loader" }
|
||||
]
|
||||
},
|
||||
require('./sass.rule.js')({
|
||||
sourceMap: false, minimize: true
|
||||
sourceMap: false, minimize: true, preserveUrl: false
|
||||
})
|
||||
]
|
||||
},
|
||||
@@ -55,8 +74,8 @@ module.exports = merge(common, {
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
names: ['vendor', 'manifest'],
|
||||
}),
|
||||
function() {
|
||||
this.plugin("done", function(stats) {
|
||||
function () {
|
||||
this.plugin("done", function (stats) {
|
||||
if (stats.compilation.errors && stats.compilation.errors.length) {
|
||||
console.log(stats.compilation.errors);
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user