| Current Path : /var/www/html/dynaweb.blunetdev.com/ |
| Current File : /var/www/html/dynaweb.blunetdev.com/webpack.config.js |
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = (env, argv) => {
return {
entry: './frontend/views/assets/js/app.js',
output: {
filename: 'app.js',
path: path.resolve(__dirname, 'www/assets'),
publicPath: '/assets/'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
// this will apply to both plain `.js` files
// AND `<script>` blocks in `.vue` files
{
test: /\.js$/,
loader: 'babel-loader'
},
// this will apply to both plain `.css` files
// AND `<style>` blocks in `.vue` files
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader',
]
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
use: [
'file-loader',
]
},
{
test: /\.s[ac]ss$/i,
use: [
"style-loader",
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader",
],
}
]
},
plugins: [
// make sure to include the plugin!
new VueLoaderPlugin()
],
resolve: {
extensions: ['*', '.js', '.vue', '.json'],
alias: {
vue: argv.mode === 'production' ? 'vue/dist/vue.min' :'vue/dist/vue.js'
}
}
}
};