forked from marionnewlevant/craftcom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
48 lines (41 loc) · 1.29 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
let mix = require('laravel-mix');
let tailwindcss = require('tailwindcss');
const sourcePath = 'web/craftidresources/src';
const distPath = 'web/craftidresources/dist';
// Set a prefix for all generated asset paths.
mix.setResourceRoot("/craftidresources/dist/");
// Override the default path to your project's public directory.
mix.setPublicPath(distPath);
mix.js(sourcePath + '/js/app.js', 'js')
.js(sourcePath + '/js/site.js', 'js')
.sass(sourcePath + '/sass/app.scss', 'css')
.sass(sourcePath + '/sass/site.scss', 'css')
.options({
processCssUrls: false,
postCss: [ tailwindcss('./tailwind-config.js') ],
})
.copy(sourcePath + '/images', distPath + '/images/')
.sourceMaps();
// https://sebastiandedeyne.com/posts/2017/typescript-with-laravel-mix/
mix.webpackConfig({
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: { appendTsSuffixTo: [/\.vue$/] },
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['*', '.js', '.jsx', '.vue', '.ts', '.tsx'],
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
});
// Run versioning on production only.
if (mix.inProduction()) {
mix.version();
}