Wow, that looks cool! Could we use that by default do you think?
You probably could. It's pretty minimal webpack changes. You include a plugin/loader and you're good to go. Here's the current TypeScript/React project I'm working on's webpack config for Storybook
/** * This extends the default webpack configuration used in storybook. */ const { resolve } = require('path'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const HappyPack = require('happypack'); module.exports = { devtool: 'cheap-module-source-map', resolve: { extensions: ['.ts', '.tsx', '.js'], alias: { types: resolve(__dirname, '../types'), helpers: resolve(__dirname, '../src', 'helpers'), services: resolve(__dirname, '../src', 'services'), reducers: resolve(__dirname, '../src', 'reducers'), actions: resolve(__dirname, '../src', 'actions'), components: resolve(__dirname, '../src', 'components'), routes: resolve(__dirname, '../src', 'routes'), utilities: resolve(__dirname, '../src', 'utilities'), assets: resolve(__dirname, '../src', 'assets'), }, }, module: { rules: [ { test: /\.tsx?$/, exclude: /node_modules/, loader: 'happypack/loader?id=ts', }, ], }, plugins: [ new HappyPack({ id: 'ts', threads: 2, loaders: [ { path: 'ts-loader', query: { happyPackMode: true }, }, ], }), // Handles type checking on another thread. new ForkTsCheckerWebpackPlugin({ async: false, tslint: true, checkSyntacticErrors: true, }), ], };
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Wow, that looks cool! Could we use that by default do you think?
You probably could. It's pretty minimal webpack changes. You include a plugin/loader and you're good to go. Here's the current TypeScript/React project I'm working on's webpack config for Storybook