phpvms/webpack.config.js

49 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-03-29 02:39:57 +08:00
/**
* Conversion of assets to front-end formats
*/
2018-03-29 02:39:57 +08:00
const path = require('path');
const webpack = require('webpack');
2018-03-29 02:39:57 +08:00
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const extractSass = new ExtractTextPlugin({
filename: __dirname + "/public/assets/js/[name].css"
});
module.exports = {
2018-03-29 02:39:57 +08:00
/**
* Main application files - for the admin, frontend, and the installer
* They are written out to the /assets/js using the key as the filename
*/
entry: {
admin: __dirname + "/resources/js/admin/app.js",
app: __dirname + "/resources/js/frontend/app.js",
2018-03-29 02:39:57 +08:00
installer: __dirname + '/resources/js/installer/app.js',
},
output: {
filename: "[name].js",
2018-03-29 02:39:57 +08:00
path: __dirname + "/public/assets/js/",
},
module: {
rules: [
/**
* Admin SASS conversions
*/
{
test: /\.scss$/,
include: [
path.resolve(__dirname, 'resources/sass/admin')
],
use: extractSass.extract({
use: [{
loader: "css-loader"
}, {
loader: "sass-loader"
}]
})
}
]
}
};