2018-03-29 02:39:57 +08:00
|
|
|
/**
|
|
|
|
* Conversion of assets to front-end formats
|
|
|
|
*/
|
2018-03-28 07:18:25 +08:00
|
|
|
|
2018-03-29 02:39:57 +08:00
|
|
|
const path = require('path');
|
2018-03-28 07:18:25 +08:00
|
|
|
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"
|
|
|
|
});
|
|
|
|
|
2018-03-28 07:18:25 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
*/
|
2018-03-28 07:18:25 +08:00
|
|
|
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',
|
2018-03-28 07:18:25 +08:00
|
|
|
},
|
|
|
|
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"
|
|
|
|
}]
|
|
|
|
})
|
|
|
|
}
|
|
|
|
]
|
2018-03-28 07:18:25 +08:00
|
|
|
}
|
|
|
|
};
|