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:
@@ -2,16 +2,16 @@
|
||||
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
|
||||
module.exports = function(options) {
|
||||
module.exports = function (options, extractSass) {
|
||||
return {
|
||||
test: /\.scss$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
use: (extractSass || ExtractTextPlugin).extract({
|
||||
use: [
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
importLoaders: 2,
|
||||
url: false,
|
||||
url: options.preserveUrl,
|
||||
sourceMap: options.sourceMap,
|
||||
minimize: options.minimize,
|
||||
}
|
||||
@@ -23,8 +23,14 @@ module.exports = function(options) {
|
||||
config: { path: __dirname + '/postcss.config.js' }
|
||||
}
|
||||
},
|
||||
{ loader:'sass-loader', options: { sourceMap: options.sourceMap } }
|
||||
{ loader: 'sass-loader', options: { sourceMap: options.sourceMap } }
|
||||
],
|
||||
fallback: [{
|
||||
loader: 'style-loader',
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
}]
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user