influxdb/ui/webpack.common.ts

88 lines
2.0 KiB
TypeScript
Raw Normal View History

const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const {CleanWebpackPlugin} = require('clean-webpack-plugin')
const webpack = require('webpack')
const {
GIT_SHA,
STATIC_DIRECTORY,
BASE_PATH,
} = require('./src/utils/env')
module.exports = {
context: __dirname,
output: {
path: path.resolve(__dirname, 'build'),
publicPath: BASE_PATH,
webassemblyModuleFilename: `${STATIC_DIRECTORY}[modulehash:10].wasm`,
sourceMapFilename: `${STATIC_DIRECTORY}[name].js.map`,
},
entry: {
app: './src/bootstrap.ts',
},
resolve: {
alias: {
src: path.resolve(__dirname, 'src'),
},
extensions: ['.tsx', '.ts', '.js', '.wasm'],
},
module: {
rules: [
{
test: /\.wasm$/,
type: 'webassembly/experimental',
},
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [{
loader: 'file-loader',
options: {
name: `${STATIC_DIRECTORY}[contenthash:10].[ext]`
}
}],
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [{
loader: 'file-loader',
options: {
name: `${STATIC_DIRECTORY}[contenthash:10].[ext]`
}
}],
},
],
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: './assets/index.html',
favicon: './assets/images/favicon.ico',
inject: 'body',
base: BASE_PATH.slice(0, -1),
}),
new webpack.ProgressPlugin(),
new webpack.EnvironmentPlugin({...process.env, GIT_SHA}),
],
stats: {
colors: true,
children: false,
modules: false,
version: false,
assetsSort: '!size',
style(clockface): upgrade to 0.0.18 (#14458) * Update dependency * Fix appearance of signin form * Fix appearance of inline label editor * Update implementation of dropdown * Remove comment * Fix appearance of auto refresh dropdown * Update implementation of time range dropdown * Update implementation of time zone dropdown * Update implementation of window selector * Fix missing button text in window selector Oooooops * Update implementation of time format dropdown * Update implementation of column selector * Update implementation of geometry dropdown * Ensure line graphs have a default color palette * Update implementation of color scheme dropdown * Update implementation of heat map color selector * Update dropdown implementations in histogram options * Update implementation of Variable Builder dropdowns * Update implementation of buckets dropdown * Tweak color of slide toggle in token row to be green * Update implementation of Generate Token dropdown * Update snapshot tests * Update bucket dropdown tests * Fix query builder test * Update onboarding buttons test * Fix some e2e tests * Fix tokens e2e tests * Fix variables e2e tests * Update implemenation of view type dropdown Also removing the empty view type from existence Co-Authored-By: Christopher Henn <chnn@users.noreply.github.com> * Fix query builder add card button Made it less prone to breakage * Fix appearance of VEO * Update styles of renamable page title * Update styles using button or icon or input * Ensure time range dropdown is not blank initially * Update implementation of variable tooltip dropdown * Update implementation of dropdowns in Add Members form * Update implementation of Color dropdown * Update implementation of dropdowns in scatter plot options * Upddate implementation of precision dropdown * Update implementation of sort by table option dropdown * Update implementation of dashboards dropdown in save as menu * Update implementations of dropdowns in task form * Update Variable control bar dropdowns * Delete unused component * Remove unused imports * Update bucket dropdown implementation in delete data form * Update searchable dropdown to use new clockface components * Delete local dropdown components * Fix failing unit tests * blerp * Coerce type in view type dropdown * Fix onboarding styles * Fix e2e tests Co-Authored-By: Andrew Watkins <121watts@users.noreply.github.com> * Fix last e2e test Co-Authored-By: Andrew Watkins <121watts@users.noreply.github.com> * build(e2e): allow cypress to run with webpack dev server
2019-07-25 19:13:51 +00:00
warningsFilter: [/export .* was not found in/, /'.\/locale' in/],
excludeAssets: [/\.(hot-update|woff|eot|ttf|svg|ico|png)/],
},
performance: {hints: false},
}