├── .gitignore ├── package.json └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .idea 3 | .DS_Store 4 | yarn.lock 5 | yarn-error.log 6 | package-lock.json 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel-nova-mix", 3 | "version": "1.0.0", 4 | "description": "Mix extension for Laravel Nova Package Development", 5 | "author": "Taylor Otwell", 6 | "license": "MIT", 7 | "main": "index.js", 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/laravel/nova-mix.git" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/laravel/nova-mix/issues" 14 | }, 15 | "peerDependencies": { 16 | "laravel-mix": "^6.0.41" 17 | }, 18 | "devDependencies": { 19 | "laravel-mix": "^6.0.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | const webpack = require('webpack'); 3 | 4 | class NovaExtension { 5 | name() { 6 | return 'nova-extension' 7 | } 8 | 9 | register(name) { 10 | this.name = name 11 | } 12 | 13 | webpackPlugins() { 14 | return new webpack.ProvidePlugin({ 15 | _: 'lodash', 16 | axios: 'axios', 17 | Errors: 'form-backend-validation' 18 | }) 19 | } 20 | 21 | webpackConfig(webpackConfig) { 22 | webpackConfig.externals = { 23 | vue: 'Vue', 24 | } 25 | 26 | webpackConfig.output = { 27 | uniqueName: this.name, 28 | } 29 | } 30 | } 31 | 32 | mix.extend('nova', new NovaExtension()); 33 | --------------------------------------------------------------------------------