Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaMaid committed Jul 4, 2018
2 parents 1c008b3 + 91e786d commit 4be2b22
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 3 deletions.
100 changes: 100 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
]
},
"engines": {
"node": ">= 7.0.0"
"node": ">= 6.0.0"
},
"dependencies": {
"@types/classnames": "*",
Expand Down Expand Up @@ -95,10 +95,12 @@
"css-loader": "^0.28.11",
"cz-conventional-changelog": "^2.1.0",
"file-loader": "^1.1.11",
"fork-ts-checker-webpack-plugin": "^0.4.2",
"gulp": "^3.9.1",
"gulp-clean-css": "^3.9.3",
"gulp-less": "^4.0.0",
"gulp-postcss": "^7.0.1",
"happypack": "^5.0.0",
"highlight.js": "^9.12.0",
"html-webpack-plugin": "^3.2.0",
"husky": "^0.14.3",
Expand Down
23 changes: 21 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const HappyPack = require('happypack');

module.exports = {
mode: 'development',
Expand All @@ -17,13 +19,13 @@ module.exports = {
rules: [
{
test: /\.(tsx|ts)$/,
use: ['ts-loader'],
use: ['happypack/loader?id=ts'],
include: [path.resolve('components'), path.resolve('docs')],
exclude: [/__tests__/],
},
{
test: /\.(css|less)$/,
use: ['style-loader', 'css-loader', 'postcss-loader', 'less-loader'],
use: ['happypack/loader?id=css'],
include: [
path.resolve('components'),
path.resolve('scripts'),
Expand Down Expand Up @@ -51,6 +53,23 @@ module.exports = {
template: path.resolve('./docs/index.html'),
favicon: path.resolve('./docs/favicon.ico'),
}),
new ForkTsCheckerWebpackPlugin(),
new HappyPack({
id: 'ts',
loaders: [
{
loader: 'ts-loader',
options: {
happyPackMode: true,
transpileOnly: true,
},
},
]
}),
new HappyPack({
id: 'css',
loaders: ['style-loader', 'css-loader', 'postcss-loader', 'less-loader']
}),
],
devServer: {
historyApiFallback: true,
Expand Down

0 comments on commit 4be2b22

Please sign in to comment.