Guest User

Untitled

a guest
Dec 10th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. const webpack = require("webpack")
  2. const path = require("path")
  3. const config = require("./config")
  4. const ExtractTextPlugin = require("extract-text-webpack-plugin")
  5.  
  6. module.exports = {
  7. "cache": true,
  8. "entry": {
  9. // "polyfills": path.join(__dirname, "", "src", "polyfills.ts"),
  10. "vendor": path.join(__dirname, "..", "app", "systemjs.config.js"),
  11. "client": path.join(__dirname, "..", "app", "main.ts"),
  12. // "styles": path.join(__dirname, "", "src", "styles", "style.root.scss");
  13. },
  14. "output": {
  15. "filename": "[name].js",
  16. "path": config.build.assetsRoot,
  17. "publicPath": process.env.NODE_ENV === "production"
  18. ? config.build.assetsPublicPath
  19. : config.dev.assetsPublicPath
  20. },
  21. "resolve": {
  22. "extensions": [".ts", ".js"]
  23. },
  24. "module": {
  25. "rules": [
  26. {
  27. "test": /\.ts$/,
  28. "loaders": [
  29. {
  30. "loader": "awesome-typescript-loader",
  31. "options": {
  32. // specify your tsconfig.json file
  33. "configFileName": path.join(__dirname, "..", "tsconfig.json")
  34. }
  35. },
  36. "angular2-template-loader"
  37. ]
  38. },
  39. {
  40. "test": /\.scss|\.css$/,
  41. "loader": ExtractTextPlugin.extract({
  42. "fallback": "style-loader",
  43. "use": ["css-loader",
  44. {
  45. "loader": "sass-loader"
  46. }]
  47. })
  48. },
  49. {
  50. "test": /\.html$/,
  51. "loaders": ["html-loader"]
  52. },
  53. {
  54. "test": /\.(ttf|eot|svg|woff|woff2)$/,
  55. "loader": "file-loader?name=fonts/[name].[ext]"
  56. }
  57. ]
  58. },
  59.  
  60. "plugins": [
  61. // bundle all you styling into one style.css file
  62. new ExtractTextPlugin({ "filename": "style.css", "allChunks": true }),
  63.  
  64. // create chunks for entries
  65. new webpack.optimize.CommonsChunkPlugin({
  66. "name": ["client", "vendor", "polyfills", "styles"]
  67. }),
  68. ]
  69. }
Add Comment
Please, Sign In to add comment