Update build

pull/16/head
Nikita Karamov 2020-07-31 18:54:51 +02:00
parent 65969039a4
commit becdbb870e
No known key found for this signature in database
GPG Key ID: E40DFE6E993540FF
1 changed files with 17 additions and 0 deletions

View File

@ -1,10 +1,17 @@
import consts from '@nickkaramoff/rollup-plugin-consts';
import license from 'rollup-plugin-license';
import postcss from 'rollup-plugin-postcss';
import postcssPluginBanner from 'postcss-banner';
import postcssPluginCalc from 'postcss-calc';
import postcssPluginCssnano from 'cssnano';
import postcssPluginMixins from 'postcss-mixins';
import postcssPluginVariables from 'postcss-css-variables';
import strip from '@rollup/plugin-strip';
import { terser } from 'rollup-plugin-terser';
import { urlBuilderMap } from './src/networks';
import networksMixin from './src/networksMixin';
const isDev = process.env.ROLLUP_WATCH || process.env.NODE_ENV === 'development';
const pkg = require('./package.json');
@ -19,6 +26,9 @@ const bannerText = `${pkg.name} v${pkg.version} by Nikita Karamov\n${pkg.homepag
* @type {Plugin[]}
*/
const plugins = [
consts({
urlBuilderMap,
}),
];
if (!isDev) {
@ -40,6 +50,13 @@ if (!isDev) {
plugins.push(postcss({
extract: `${pkg.name}.min.css`,
plugins: [
postcssPluginMixins({
mixins: {
networks: networksMixin,
},
}),
postcssPluginVariables(),
postcssPluginCalc(),
(!isDev) && postcssPluginCssnano({
preset: 'default',
}),