forked from statamic/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
64 lines (56 loc) · 1.5 KB
/
webpack.mix.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const mix = require('laravel-mix');
const webpack = require('webpack');
const tailwindcss = require('tailwindcss');
const src = 'resources';
const dest = 'resources/dist';
mix.setPublicPath('./resources/dist');
mix.sass(`${src}/sass/cp.scss`, `${dest}/css`).options({
processCssUrls: false,
postCss: [
tailwindcss('./tailwind.config.js'),
require('autoprefixer')
],
});
mix.js(`${src}/js/app.js`, `${dest}/js`);
mix.extract([
'@popperjs/core',
'@shopify/draggable',
'alpinejs',
'autosize',
'axios',
'codemirror',
'cookies-js',
'dmuploader',
'jquery-ui',
'jquery',
'luminous-lightbox',
'marked-plaintext',
'marked',
'moment',
'mousetrap',
'speakingurl',
'sweetalert',
'underscore',
'v-calendar',
'vue-clickaway',
'vue-js-modal',
'vue-js-popover',
'vue'
]);
mix.copyDirectory(`${src}/img`, `${dest}/img`);
mix.copyDirectory(`${src}/svg`, `${dest}/svg`);
mix.copyDirectory(`${src}/audio`, `${dest}/audio`);
mix.copyDirectory(`${src}/fonts`, `${dest}/fonts`);
mix.sourceMaps();
mix.options({ extractVueStyles: true });
mix.webpackConfig({
devtool: 'source-map',
plugins: [
// Some vendor files reference globals
new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery" }),
// Our files reference globals too
new webpack.ProvidePlugin({ Vue: "vue" }),
new webpack.ProvidePlugin({ Alpine: "Alpine" }),
new webpack.ProvidePlugin({ _: "underscore" })
]
})