Guest User

Untitled

a guest
Jul 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. const ExtractTextPlugin = require('extract-text-webpack-plugin');
  4. const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
  5. const bundleOutputDir = './wwwroot/dist';
  6.  
  7. module.exports = (env) => {
  8. const isDevBuild = !(env && env.prod);
  9. return [{
  10. stats: { modules: false },
  11. entry: { 'main': './ClientApp/boot.tsx' },
  12. resolve: { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
  13. output: {
  14. path: path.join(__dirname, bundleOutputDir),
  15. filename: '[name].js',
  16. publicPath: 'dist/'
  17. },
  18. module: {
  19. rules: [
  20. { test: /.tsx?$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' },
  21. { test: /.css$/, use: isDevBuild ? ['style-loader', 'css-loader'] : ExtractTextPlugin.extract({ use: 'css-loader?minimize' }) },
  22. { test: /.(png|jpg|jpeg|gif|svg)$/, loader: 'file-loader' },
  23. { test: /.woff(2)?(?v=[0-9].[0-9].[0-9])?$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" },
  24. { test: /.(ttf|eot|svg)(?v=[0-9].[0-9].[0-9])?$/, loader: "file-loader" }
  25. ]
  26. },
  27. plugins: [
  28. new CheckerPlugin(),
  29. new webpack.DllReferencePlugin({
  30. context: __dirname,
  31. manifest: require('./wwwroot/dist/vendor-manifest.json')
  32. })
  33. ].concat(isDevBuild ? [
  34. // Plugins that apply in development builds only
  35. new webpack.SourceMapDevToolPlugin({
  36. filename: '[file].map', // Remove this line if you prefer inline source maps
  37. moduleFilenameTemplate: path.relative(bundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk
  38. })
  39. ] : [
  40. // Plugins that apply in production builds only
  41. new webpack.optimize.UglifyJsPlugin(),
  42. new ExtractTextPlugin('site.css')
  43. ])
  44. }];
  45. };
  46.  
  47. import Logo from '../css/images/logo.png';
Add Comment
Please, Sign In to add comment