Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. webpack.config.js
  2. /**
  3. * As our first step, we'll pull in the user's webpack.mix.js
  4. * file. Based on what the user requests in that file,
  5. * a generic config object will be constructed for us.
  6. */
  7.  
  8. require('../src/index');
  9. require(Mix.paths.mix());
  10.  
  11. /**
  12. * Just in case the user needs to hook into this point
  13. * in the build process, we'll make an announcement.
  14. */
  15.  
  16. Mix.dispatch('init', Mix);
  17.  
  18. /**
  19. * Now that we know which build tasks are required by the
  20. * user, we can dynamically create a configuration object
  21. * for Webpack. And that's all there is to it. Simple!
  22. */
  23.  
  24. let WebpackConfig = require('../src/builder/WebpackConfig');
  25.  
  26. module.exports = new WebpackConfig().build();
  27. -----------------------------------------------------------------------------------------------------
  28. webpack.mix.js
  29.  
  30. let mix = require('laravel-mix');
  31.  
  32. /*
  33. |--------------------------------------------------------------------------
  34. | Mix Asset Management
  35. |--------------------------------------------------------------------------
  36. |
  37. | Mix provides a clean, fluent API for defining some Webpack build steps
  38. | for your Laravel application. By default, we are compiling the Sass
  39. | file for the application as well as bundling up all the JS files.
  40. |
  41. */
  42.  
  43. //mix.react('resources/assets/js/app.js', 'public/js')
  44.  
  45.  
  46. mix.react('C:/xampp/htdocs/arch/resources/assets/js/components/app.js', 'public/js')
  47. .sass('resources/assets/sass/app.scss', 'public/css');
  48.  
  49. module.exports.module = {
  50. rules: [
  51.  
  52. {
  53. test: /\.jsx?$/,
  54. exclude: /(node_modules|bower_components)/,
  55. loader: 'babel-loader',
  56. exclude: /node_modules/,
  57. query: {
  58. babelrc: false,
  59. presets: [
  60. 'es2015',
  61. 'react',
  62. 'stage-1'
  63. ]
  64. }
  65. },
  66.  
  67. {
  68. test: /\.(png|jpg|gif)$/,
  69. loader: 'file-loader',
  70. options: {
  71. name: '[name].[ext]?[hash]'
  72. }
  73. },
  74.  
  75. {
  76. test: /\.(woff2?|ttf|eot|svg|otf)$/,
  77. loader: 'file-loader',
  78. options: {
  79. name: 'fonts/[name].[ext]?[hash]',
  80. publicPath: '/'
  81. }
  82. }
  83. ]
  84. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement