Skip to content

Commit

Permalink
feat(app-icon): add config for apple-app-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
luhmann committed May 5, 2018
1 parent 4d447d6 commit efcb3c7
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const path = require("path");
const glob = require("glob");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const WebappWebpackPlugin = require("webapp-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const PurgecssPlugin = require("purgecss-webpack-plugin");
const path = require('path');
const glob = require('glob');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebappWebpackPlugin = require('webapp-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const PurgecssPlugin = require('purgecss-webpack-plugin');

const PATHS = {
src: path.join(__dirname, "src"),
build: path.join(__dirname, "build")
src: path.join(__dirname, 'src'),
build: path.join(__dirname, 'build'),
};

class TailwindExtractor {
Expand All @@ -17,11 +17,11 @@ class TailwindExtractor {
}

module.exports = (env, argv) => ({
entry: path.join(PATHS.src, "index.bs.js"),
mode: "development",
entry: path.join(PATHS.src, 'index.bs.js'),
mode: 'development',
output: {
path: PATHS.build,
filename: "index.js"
filename: 'index.js',
},
module: {
rules: [
Expand All @@ -31,67 +31,67 @@ module.exports = (env, argv) => ({
use: [
{
loader:
argv && argv.mode === "production"
argv && argv.mode === 'production'
? MiniCssExtractPlugin.loader
: "style-loader"
: 'style-loader',
},
{
loader: "css-loader",
loader: 'css-loader',
options: {
importLoaders: 1
}
importLoaders: 1,
},
},
{
loader: "postcss-loader"
}
]
}
]
loader: 'postcss-loader',
},
],
},
],
},
plugins: [
...(argv && argv.mode === "production"
...(argv && argv.mode === 'production'
? [
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "[name].css",
chunkFilename: "[id].css"
filename: '[name].css',
chunkFilename: '[id].css',
}),
new PurgecssPlugin({
paths: [
...glob.sync(`${PATHS.src}/**/*.js`),
path.join(__dirname, "config", "index.html")
path.join(__dirname, 'config', 'index.html'),
],
extractors: [
{
extractor: TailwindExtractor,

// Specify the file extensions to include when scanning for
// class names.
extensions: ["js", "html"]
}
]
})
extensions: ['js', 'html'],
},
],
}),
]
: []),
new HtmlWebpackPlugin({
title: "What's with dinner?",
template: path.join(__dirname, "config", "index.html"),
inject: false
template: path.join(__dirname, 'config', 'index.html'),
inject: false,
}),
new WebappWebpackPlugin({
logo: path.resolve(__dirname, "config", "favicon.png"),
logo: path.resolve(__dirname, 'config', 'favicon.png'),
favicons: {
icons: {
android: false,
appleIcon: false,
appleIcon: true,
coast: false,
firefox: false,
yandex: false,
windows: false,
appleStartup: false
}
}
})
]
appleStartup: false,
},
},
}),
],
});

0 comments on commit efcb3c7

Please sign in to comment.