forked from sagi/seepur
89 lines
2.4 KiB
JavaScript
89 lines
2.4 KiB
JavaScript
const path = require('path');
|
|
const webpack = require('webpack');
|
|
const {VueLoaderPlugin} = require('vue-loader');
|
|
require('babel-loader');
|
|
require('ts-loader');
|
|
const resolve = relativePath => path.resolve(__dirname, '..', relativePath);
|
|
module.exports = {
|
|
mode: 'development',
|
|
entry: {
|
|
'components/navbar': './resources/scripts/components/navbar.ts',
|
|
'views/register': './resources/scripts/views/register.ts',
|
|
'applications/home': './resources/scripts/applications/home/main.vue',
|
|
'applications/admin': './resources/scripts/applications/admin/main.vue',
|
|
},
|
|
output: {
|
|
filename: 'scripts/[name]/app.bundle.js',
|
|
path: path.resolve(__dirname, 'public'),
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
// vue-loader config to load `.vue` files or single file components.
|
|
test: /\.vue$/,
|
|
loader: 'vue-loader',
|
|
options: {
|
|
loaders: {
|
|
// https://vue-loader.vuejs.org/guide/scoped-css.html#mixing-local-and-global-styles
|
|
css: [
|
|
'vue-style-loader', {
|
|
loader: 'css-loader',
|
|
}
|
|
],
|
|
ts: [
|
|
'ts-loader',
|
|
],
|
|
js: [
|
|
'babel-loader',
|
|
],
|
|
},
|
|
cacheBusting: true,
|
|
},
|
|
},
|
|
{
|
|
test: /\.ts?$/,
|
|
use: [
|
|
{loader: 'babel-loader'}, {
|
|
loader: 'ts-loader',
|
|
options: {
|
|
appendTsSuffixTo: [/\.vue$/, /\.ts$/],
|
|
appendTsxSuffixTo: [/\.tsx\.vue$/]
|
|
}
|
|
}
|
|
],
|
|
exclude: /node_modules/
|
|
},
|
|
{
|
|
// This is required for other javascript you are gonna write besides
|
|
// vue.
|
|
test: /\.js$/,
|
|
loader: 'babel-loader',
|
|
include: [
|
|
resolve('src'),
|
|
resolve('node_modules/webpack-dev-server/client'),
|
|
],
|
|
},
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.NamedModulesPlugin(),
|
|
new VueLoaderPlugin(),
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
],
|
|
resolve: {
|
|
/**
|
|
* The compiler-included build of vue which allows to use vue templates
|
|
* without pre-compiling them
|
|
*/
|
|
alias: {
|
|
'vue$': 'vue/dist/vue.esm.js',
|
|
},
|
|
extensions: ['*', '.vue', '.js', '.ts', '.json'],
|
|
},
|
|
watchOptions: {aggregateTimeout: 300, poll: 1000},
|
|
// webpack outputs performance related stuff in the browser.
|
|
performance: {
|
|
hints: false,
|
|
},
|
|
node: {fs: 'empty'}
|
|
}
|