Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- webpack.config.js
- /**
- * As our first step, we'll pull in the user's webpack.mix.js
- * file. Based on what the user requests in that file,
- * a generic config object will be constructed for us.
- */
- require('../src/index');
- require(Mix.paths.mix());
- /**
- * Just in case the user needs to hook into this point
- * in the build process, we'll make an announcement.
- */
- Mix.dispatch('init', Mix);
- /**
- * Now that we know which build tasks are required by the
- * user, we can dynamically create a configuration object
- * for Webpack. And that's all there is to it. Simple!
- */
- let WebpackConfig = require('../src/builder/WebpackConfig');
- module.exports = new WebpackConfig().build();
- -----------------------------------------------------------------------------------------------------
- webpack.mix.js
- let mix = require('laravel-mix');
- /*
- |--------------------------------------------------------------------------
- | Mix Asset Management
- |--------------------------------------------------------------------------
- |
- | Mix provides a clean, fluent API for defining some Webpack build steps
- | for your Laravel application. By default, we are compiling the Sass
- | file for the application as well as bundling up all the JS files.
- |
- */
- //mix.react('resources/assets/js/app.js', 'public/js')
- mix.react('C:/xampp/htdocs/arch/resources/assets/js/components/app.js', 'public/js')
- .sass('resources/assets/sass/app.scss', 'public/css');
- module.exports.module = {
- rules: [
- {
- test: /\.jsx?$/,
- exclude: /(node_modules|bower_components)/,
- loader: 'babel-loader',
- exclude: /node_modules/,
- query: {
- babelrc: false,
- presets: [
- 'es2015',
- 'react',
- 'stage-1'
- ]
- }
- },
- {
- test: /\.(png|jpg|gif)$/,
- loader: 'file-loader',
- options: {
- name: '[name].[ext]?[hash]'
- }
- },
- {
- test: /\.(woff2?|ttf|eot|svg|otf)$/,
- loader: 'file-loader',
- options: {
- name: 'fonts/[name].[ext]?[hash]',
- publicPath: '/'
- }
- }
- ]
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement