Completed
Push — 1.1 ( 4d5846...b85b4d )
by Quentin
12s
created

webpack.mix.js (1 issue)

Labels
Severity
1
let mix = require('laravel-mix')
2
let webpack = require('webpack')
3
4
/*
5
 |--------------------------------------------------------------------------
6
 | Mix Asset Management
7
 |--------------------------------------------------------------------------
8
 |
9
 | Mix provides a clean, fluent API for defining some Webpack build steps
10
 | for your Laravel application.
11
 |
12
 */
13
14
mix.setPublicPath('public')
15
16
mix.options({
17
  processCssUrls: false,
18
  purifyCss: false // Remove unused CSS selectors.
19
})
20
21
mix.webpackConfig({
22
  resolve: {
23
    alias: {
24
      '@': path.resolve('frontend/js'),
0 ignored issues
show
The variable path seems to be never declared. If this is a global, consider adding a /** global: path */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
25
      'styles': path.resolve('frontend/scss')
26
    }
27
  },
28
  plugins: [
29
    new webpack.optimize.CommonsChunkPlugin({
30
      name: 'assets/admin/js/vendor',
31
      minChunks: function (module) {
32
        // This prevents stylesheet resources with these extensions
33
        // from being moved from their original chunk to the vendor chunk
34
        if (module.resource && (/^.*\.(css|scss|less)$/).test(module.resource)) {
35
          return false
36
        }
37
        return module.context && module.context.indexOf('node_modules') !== -1
38
      }
39
    }),
40
    new webpack.optimize.CommonsChunkPlugin({
41
      name: 'assets/admin/js/manifest',
42
      minChunks: Infinity
43
    })
44
  ],
45
  module: {
46
    rules: [
47
      {
48
        test: /\.(js|vue)$/,
49
        exclude: /node_modules/,
50
        loader: 'eslint-loader',
51
        enforce: 'pre',
52
        include: [path.resolve('frontend/js')],
53
        options: {
54
          formatter: require('eslint-friendly-formatter')
55
        }
56
      }
57
    ]
58
  }
59
})
60
61
mix.copyDirectory('frontend/fonts', 'public/assets/admin/fonts')
62
63
mix.js(
64
  'frontend/js/main-listing.js',
65
  'public/assets/admin/js'
66
).js(
67
  'frontend/js/main-form.js',
68
  'public/assets/admin/js'
69
).js(
70
  'frontend/js/main-buckets.js',
71
  'public/assets/admin/js'
72
).js(
73
  'frontend/js/main-dashboard.js',
74
  'public/assets/admin/js'
75
).sass(
76
  'frontend/scss/app.scss',
77
  'public/assets/admin/css'
78
)
79
80
if (mix.inProduction()) {
81
  mix.version()
82
} else {
83
  mix.sourceMaps()
84
}
85