mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Added babel-loader caching to improve subsequent build times. (#777)
This commit is contained in:
committed by
Steve Sanderson
parent
efcfc0b9a6
commit
365b2c50cb
@@ -10,14 +10,14 @@ module.exports = (env) => {
|
|||||||
// Configuration in common to both client-side and server-side bundles
|
// Configuration in common to both client-side and server-side bundles
|
||||||
const sharedConfig = () => ({
|
const sharedConfig = () => ({
|
||||||
stats: { modules: false },
|
stats: { modules: false },
|
||||||
resolve: { extensions: [ '.js', '.jsx', '.ts', '.tsx' ] },
|
resolve: { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
publicPath: '/dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix
|
publicPath: '/dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{ test: /\.tsx?$/, include: /ClientApp/, use: 'babel-loader' },
|
{ test: /\.tsx?$/, include: /ClientApp/, use: { loader: 'babel-loader', options: { cacheDirectory: true } } },
|
||||||
{ test: /\.tsx?$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }
|
{ test: /\.tsx?$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ module.exports = (env) => {
|
|||||||
return [{
|
return [{
|
||||||
stats: { modules: false },
|
stats: { modules: false },
|
||||||
entry: { 'main': './ClientApp/boot.tsx' },
|
entry: { 'main': './ClientApp/boot.tsx' },
|
||||||
resolve: { extensions: [ '.js', '.jsx', '.ts', '.tsx' ] },
|
resolve: { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, bundleOutputDir),
|
path: path.join(__dirname, bundleOutputDir),
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
@@ -17,7 +17,7 @@ module.exports = (env) => {
|
|||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{ test: /\.ts(x?)$/, include: /ClientApp/, use: 'babel-loader' },
|
{ test: /\.ts(x?)$/, include: /ClientApp/, use: { loader: 'babel-loader', options: { cacheDirectory: true } } },
|
||||||
{ test: /\.tsx?$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' },
|
{ test: /\.tsx?$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' },
|
||||||
{ test: /\.css$/, use: isDevBuild ? ['style-loader', 'css-loader'] : ExtractTextPlugin.extract({ use: 'css-loader' }) },
|
{ test: /\.css$/, use: isDevBuild ? ['style-loader', 'css-loader'] : ExtractTextPlugin.extract({ use: 'css-loader' }) },
|
||||||
{ test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }
|
{ test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }
|
||||||
|
|||||||
Reference in New Issue
Block a user