mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
80 lines
1.9 KiB
JavaScript
80 lines
1.9 KiB
JavaScript
const path = require('path');
|
|
const scssPath = path.resolve(__dirname, '../../website/src/scss');
|
|
|
|
console.log(path.resolve(__dirname, 'node_modules/bootstrap', require('bootstrap/package.json').sass));
|
|
|
|
module.exports = {
|
|
|
|
mode: ('development' === process.env.NODE_ENV) && 'development' || 'production',
|
|
|
|
...(('development' === process.env.NODE_ENV) && {
|
|
watch: true,
|
|
}),
|
|
|
|
entry: [
|
|
path.resolve(scssPath, 'bootstrap.scss'),
|
|
path.resolve(scssPath, 'main.scss'),
|
|
],
|
|
|
|
output: {
|
|
path: path.resolve(__dirname, '../../website'),
|
|
filename: 'js/main.js',
|
|
},
|
|
|
|
resolve: {
|
|
alias: {
|
|
bootstrap: path.resolve(__dirname, 'node_modules/bootstrap', require('bootstrap/package.json').sass),
|
|
},
|
|
},
|
|
|
|
module: {
|
|
rules: [{
|
|
test: /\.js$/,
|
|
exclude: /(node_modules)/,
|
|
use: [{
|
|
loader: 'babel-loader',
|
|
options: {
|
|
presets: ['@babel/preset-env'],
|
|
},
|
|
}],
|
|
}, {
|
|
test: /\.scss$/,
|
|
use: [{
|
|
loader: 'file-loader',
|
|
options: {
|
|
sourceMap: true,
|
|
outputPath: (url, entryPath, context) => {
|
|
if (0 === entryPath.indexOf(scssPath)) {
|
|
const outputFile = entryPath.slice(entryPath.lastIndexOf('/') + 1, -5)
|
|
const outputPath = entryPath.slice(0, entryPath.lastIndexOf('/')).slice(scssPath.length + 1)
|
|
return `./css/${outputPath}/${outputFile}.css`
|
|
}
|
|
return `./css/${url}`
|
|
},
|
|
},
|
|
}, {
|
|
loader: 'postcss-loader',
|
|
options: {
|
|
options: {},
|
|
plugins: () => ([
|
|
require('autoprefixer'),
|
|
('production' === process.env.NODE_ENV) && require('cssnano'),
|
|
].filter(plugin => plugin)),
|
|
}
|
|
}, {
|
|
loader: 'sass-loader',
|
|
options: {
|
|
implementation: require('sass'),
|
|
implementation: require('sass'),
|
|
sourceMap: ('development' === process.env.NODE_ENV),
|
|
sassOptions: {
|
|
importer: require('node-sass-glob-importer')(),
|
|
precision: 10,
|
|
},
|
|
},
|
|
}],
|
|
}],
|
|
},
|
|
|
|
};
|