-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add format/lint step for select files for now
Prettier will use defaults, we skip a bunch of files for now.
- Loading branch information
Showing
4 changed files
with
50 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.html | ||
*.css | ||
*.scss | ||
*.js | ||
*.yml | ||
*.yaml | ||
# Actually check these files | ||
!static-src/client.js | ||
!webpack.config.js |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,52 @@ | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
const webpack = require("webpack"); | ||
const path = require("path"); | ||
|
||
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); | ||
const TerserPlugin = require('terser-webpack-plugin'); | ||
const TerserPlugin = require("terser-webpack-plugin"); | ||
|
||
module.exports = { | ||
entry: './static-src/index.js', | ||
entry: "./static-src/index.js", | ||
output: { | ||
path: path.resolve(__dirname, './www/bundle'), | ||
filename: 'bundle.js' | ||
path: path.resolve(__dirname, "./www/bundle"), | ||
filename: "bundle.js", | ||
}, | ||
module: { | ||
rules: [{ | ||
rules: [ | ||
{ | ||
test: /\.scss$/, | ||
use: [ | ||
MiniCssExtractPlugin.loader, | ||
'css-loader', | ||
'sass-loader' | ||
] | ||
}, { | ||
// the file-loader emits files directly to OUTPUT_DIR/fonts | ||
test: /\.(woff(2)?|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: 'file-loader?name=./fonts/[name].[ext]', | ||
}, { | ||
// Image loader | ||
// the file-loader emits files directly to OUTPUT_DIR/img | ||
test: /\.(png|gif|jpg|jpeg)$/, | ||
loaders: ['file-loader?name=./img/[name].[ext]'] | ||
}] | ||
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"], | ||
}, | ||
{ | ||
// the file-loader emits files directly to OUTPUT_DIR/fonts | ||
test: /\.(woff(2)?|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: "file-loader?name=./fonts/[name].[ext]", | ||
}, | ||
{ | ||
// Image loader | ||
// the file-loader emits files directly to OUTPUT_DIR/img | ||
test: /\.(png|gif|jpg|jpeg)$/, | ||
loaders: ["file-loader?name=./img/[name].[ext]"], | ||
}, | ||
], | ||
}, | ||
optimization: { | ||
minimizer: [ | ||
new TerserPlugin(), | ||
new OptimizeCSSAssetsPlugin({}) | ||
] | ||
minimizer: [new TerserPlugin(), new OptimizeCSSAssetsPlugin({})], | ||
}, | ||
plugins: [ | ||
new MiniCssExtractPlugin({ | ||
// Options similar to the same options in webpackOptions.output | ||
filename: '[name].css', | ||
path: path.resolve(__dirname, './www/bundle'), | ||
chunkFilename: '[id].css' | ||
filename: "[name].css", | ||
path: path.resolve(__dirname, "./www/bundle"), | ||
chunkFilename: "[id].css", | ||
}), | ||
|
||
// Makes jQuery (required for bootstrap4) available to other JS includes | ||
// https://webpack.js.org/plugins/provide-plugin/ | ||
new webpack.ProvidePlugin({ | ||
$: 'jquery', | ||
jQuery: 'jquery', | ||
'window.jQuery': 'jquery' | ||
$: "jquery", | ||
jQuery: "jquery", | ||
"window.jQuery": "jquery", | ||
}), | ||
] | ||
], | ||
}; |