1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 'use strict'
- const MiniCssExtractPlugin = require("mini-css-extract-plugin");
- const { VueLoaderPlugin } = require('vue-loader')
- const utils = require('./utils')
- const themePath = 'web/themes/custom/materiotheme'
- module.exports = {
- resolve: {
- extensions: ['.js', '.vue', '.json'],
- alias: {
- 'vue': 'vue/dist/vue.js',
- 'theme': utils.resolve(themePath),
- 'vuejs': utils.resolve(themePath+'/vuejs')
- }
- },
- entry: {
- 'main': utils.resolve(themePath + '/assets/scripts/main.js'),
- },
- output: {
- path: utils.resolve(themePath + '/assets/dist/'),
- filename: '[name].js'
- },
- module: {
- rules: [
- {
- test: /\.(js|vue)$/,
- loader: 'eslint-loader',
- enforce: 'pre',
- exclude: /node_modules/,
- options: {
- emitError: true,
- emitWarning: true
- }
- },
- {
- test: /\.vue$/,
- use: 'vue-loader'
- },
- {
- test: /\.js$/,
- use: {
- loader: 'babel-loader',
- }
- }
- // , {
- // test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
- // use: {
- // loader: 'url-loader',
- // options: {
- // limit: 10000,
- // name: utils.assetsPath('img/[name].[hash:7].[ext]')
- // }
- // }
- // }, {
- // test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
- // use: {
- // loader: 'url-loader',
- // options: {
- // limit: 10000,
- // name: utils.assetsPath('media/[name].[hash:7].[ext]')
- // }
- // }
- // }, {
- // test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
- // use: {
- // loader: 'url-loader',
- // options: {
- // limit: 10000,
- // name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
- // }
- // }
- // }
- ]
- },
- plugins: [
- new MiniCssExtractPlugin({
- path: utils.resolve(themePath + '/assets/dist/'),
- filename: '[name].css'
- }),
- new VueLoaderPlugin()
- ]
- }
|