Work so far in refactoring front-end

- Mainly getting rid of existing css/js
- No longer linking to stuff like a11y.css
- Creating a FrontPageController to better deal with the home page
This commit is contained in:
Jonny Barnes 2019-07-26 10:40:56 +01:00
parent 30f9b0f557
commit 5ef23376be
135 changed files with 7461 additions and 100 deletions

71
webpack.config.js vendored
View file

@ -1,40 +1,37 @@
const webpack = require('webpack');
const Dotenv = require('dotenv-webpack');
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const config = {
context: __dirname + '/resources/es6-orig',
entry: {
colours: './colours.js',
links: './links.js',
maps: './maps.js',
piwik: './piwik.js',
places: './places.js'
},
output: {
filename: '[name].js',
path: __dirname + '/public/assets/js'
},
devtool: 'source-map',
module: {
noParse: [/mapbox-gl\.js$/],
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
}
}
}
module.exports = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
devtool: 'source-map',
entry: [
'./resources/sass/app.scss'
],
output: {
path: path.resolve('./public/assets'),
},
module: {
rules: [{
test: /\.scss$/,
use: [{
loader: MiniCssExtractPlugin.loader, options: {
sourceMap: true
}
}, {
loader: 'css-loader', options: {
sourceMap: true
}
}, {
loader: 'sass-loader', options: {
sourceMap: true,
}
}]
}]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'app.css',
chunkFilename: 'app.css',
}),
]
},
plugins: [
new Dotenv({
path: './.env'
})
]
};
module.exports = config;