|
1 | | -const mix = require('laravel-mix') |
2 | | -const webpack = require('webpack') |
3 | | -const path = require('path') |
| 1 | +const mix = require('laravel-mix'); |
| 2 | +const webpack = require('webpack'); |
| 3 | +const path = require('path'); |
4 | 4 |
|
5 | 5 | class NovaExtension { |
6 | | - name() { |
7 | | - return 'nova-extension' |
8 | | - } |
9 | | - |
10 | | - register(name) { |
11 | | - this.name = name |
12 | | - } |
13 | | - |
14 | | - webpackPlugins() { |
15 | | - return new webpack.ProvidePlugin({ |
16 | | - _: 'lodash', |
17 | | - Errors: 'form-backend-validation', |
18 | | - }) |
19 | | - } |
| 6 | + name() { |
| 7 | + return 'nova-extension'; |
| 8 | + } |
20 | 9 |
|
21 | | - webpackConfig(webpackConfig) { |
22 | | - webpackConfig.externals = { |
23 | | - vue: 'Vue', |
| 10 | + register(name) { |
| 11 | + this.name = name; |
24 | 12 | } |
25 | 13 |
|
26 | | - webpackConfig.resolve.alias = { |
27 | | - ...(webpackConfig.resolve.alias || {}), |
28 | | - 'laravel-nova': path.join( |
29 | | - __dirname, |
30 | | - '../../vendor/laravel/nova/resources/js/mixins/packages.js' |
31 | | - ), |
| 14 | + webpackPlugins() { |
| 15 | + return new webpack.ProvidePlugin({ |
| 16 | + _: 'lodash', |
| 17 | + Errors: 'form-backend-validation', |
| 18 | + }); |
32 | 19 | } |
33 | 20 |
|
34 | | - webpackConfig.output = { |
35 | | - uniqueName: this.name, |
| 21 | + webpackConfig(webpackConfig) { |
| 22 | + webpackConfig.externals = { |
| 23 | + vue: 'Vue', |
| 24 | + }; |
| 25 | + |
| 26 | + webpackConfig.resolve.alias = { |
| 27 | + ...(webpackConfig.resolve.alias || {}), |
| 28 | + 'laravel-nova': path.join( |
| 29 | + __dirname, |
| 30 | + '../../vendor/laravel/nova/resources/js/mixins/packages.js' |
| 31 | + ), |
| 32 | + }; |
| 33 | + |
| 34 | + webpackConfig.output = { |
| 35 | + uniqueName: this.name, |
| 36 | + }; |
36 | 37 | } |
37 | | - } |
38 | 38 | } |
39 | 39 |
|
40 | | -mix.extend('nova', new NovaExtension()) |
| 40 | +mix.extend('nova', new NovaExtension()); |
0 commit comments