Skip to content

Instantly share code, notes, and snippets.

@lighth7015
Created August 23, 2018 11:20
Show Gist options
  • Save lighth7015/44d9e1b9efa20648402dc1a8c6d93194 to your computer and use it in GitHub Desktop.
Save lighth7015/44d9e1b9efa20648402dc1a8c6d93194 to your computer and use it in GitHub Desktop.
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"target": "es5",
"strict": false,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"declaration": true,
"rootDir": "./",
"outDir": "../../",
"sourceMap": true,
"lib": [ "es2016", "dom" ],
"typeRoots": [
"node_modules/@types",
"typings"
],
"baseUrl": "./resources/assets",
"paths": {
"app/*": [ "app/*" ],
"components/*": [ "components/*" ],
},
},
"exclude": [
"backup",
"vendor"
]
}
const mix = require('laravel-mix');
const sprintf = require('locutus/php/strings/sprintf');
const path = require('path');
const base = 'resources/assets';
const root = (prefix = '') =>
path.resolve(__dirname, path.join('app', prefix));
const resolve = (dirname = '') => (
console.log(sprintf('resolve: %-16s => %s', dirname, path.resolve(__dirname, base, dirname))),
path.resolve(__dirname, 'resources/assets', dirname));
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| your Laravel application. By default, we compile the Sass file for the
| application as well as bundling up all the JS files.
|
*/
mix.webpackConfig({
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.ts?$/,
loader: 'babel-loader',
options: {
presets: [ 'env' ]
}
},
{
test: /\.html$/,
loader: 'raw-loader'
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader'
}
]
},
resolve: {
alias: {
base: resolve(),
app: resolve('app'),
views: resolve('views'),
store: resolve('store'),
components: resolve('components'),
shared: resolve('shared'),
plugins: resolve('shared/plugins'),
services: resolve('shared/services'),
styles: resolve('shared/styles')
},
extensions: [ '.js', '.ts' ]
}});
mix.options({
extractVueStyles: 'public/styles/base.css',
processCssUrls: false,
imgLoaderOptions: {
enabled: false
},
uglify: {
compress: false,
mangle: false,
},
uglifyCss: false,
postCss: [
require('autoprefixer')
],
clearConsole: true
})
.ts('resources/assets/app.ts', 'public/PharmAssist')
// .stylus('node_modules/vuetify/src/stylus/main.styl', 'public/WebCore/PharmAssist')
// .sourceMaps()
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment