-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6f24e7
commit fddd2cf
Showing
10 changed files
with
251 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,18 @@ | ||
const path = require('path'); | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
|
||
export const getWebpackDevConfigPartial = function(projectRoot: string, appConfig: any) { | ||
const appRoot = path.resolve(projectRoot, appConfig.root); | ||
const styles = appConfig.styles | ||
? appConfig.styles.map((style: string) => path.resolve(appRoot, style)) | ||
: []; | ||
const cssLoaders = ['style-loader', 'css-loader?sourcemap', 'postcss-loader']; | ||
|
||
return { | ||
output: { | ||
path: path.resolve(projectRoot, appConfig.outDir), | ||
filename: '[name].bundle.js', | ||
sourceMapFilename: '[name].bundle.map', | ||
chunkFilename: '[id].chunk.js' | ||
}, | ||
module: { | ||
rules: [ | ||
// outside of main, load it via style-loader for development builds | ||
{ | ||
include: styles, | ||
test: /\.css$/, | ||
loaders: cssLoaders | ||
}, { | ||
include: styles, | ||
test: /\.styl$/, | ||
loaders: [...cssLoaders, 'stylus-loader?sourcemap'] | ||
}, { | ||
include: styles, | ||
test: /\.less$/, | ||
loaders: [...cssLoaders, 'less-loader?sourcemap'] | ||
}, { | ||
include: styles, | ||
test: /\.scss$|\.sass$/, | ||
loaders: [...cssLoaders, 'sass-loader?sourcemap'] | ||
}, | ||
] | ||
} | ||
plugins: [ | ||
new ExtractTextPlugin({filename: '[name].bundle.css'}) | ||
] | ||
}; | ||
}; |
Oops, something went wrong.