-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed to type:module in package.json so we can have modern JS
- Loading branch information
Showing
14 changed files
with
44 additions
and
86 deletions.
There are no files selected for viewing
File renamed without changes.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"plugins": [ | ||
"@babel/plugin-transform-runtime" | ||
], | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"edge": "17", | ||
"firefox": "60", | ||
"chrome": "67", | ||
"safari": "11.1" | ||
}, | ||
"useBuiltIns": "entry", | ||
"corejs": "3.6.5" | ||
} | ||
] | ||
] | ||
} |
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
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,27 +1,33 @@ | ||
// Autogenerated by Mojo::Alien::rollup 1.02 | ||
const fs = require('fs'); | ||
const pkg = require('./package.json'); | ||
const path = require('path'); | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import eslint from '@rollup/plugin-eslint'; | ||
import path from 'path'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import sass from 'sass'; | ||
import scss from 'rollup-plugin-scss'; | ||
import svelte from 'rollup-plugin-svelte'; | ||
import {babel} from '@rollup/plugin-babel'; | ||
import {terser} from 'rollup-plugin-terser'; | ||
|
||
const assetsDir = process.env.ROLLUP_ASSETS_DIR || path.resolve(__dirname, 'assets'); | ||
const isDev = process.env.NODE_ENV !== 'production'; | ||
const fileKey = isDev ? 'development' : parseInt((new Date().getTime() / 1000), 10).toString(16); | ||
const outDir = process.env.ROLLUP_OUT_DIR || path.resolve(__dirname, 'dist'); | ||
const ts = parseInt((new Date().getTime() / 1000), 10).toString(16); | ||
|
||
function outPath(name) { | ||
return path.resolve(outDir, name.replace(/\[hash\]/, isDev ? 'development' : ts)); | ||
} | ||
|
||
const config = { | ||
input: path.resolve(assetsDir, 'index.js'), | ||
output: {format: 'iife', sourcemap: true}, | ||
output: {format: 'iife', sourcemap: true, file: path.resolve(outDir, `convos.${fileKey}.js`)}, | ||
plugins: [], | ||
watch: {clearScreen: false}, | ||
}; | ||
|
||
const includeFile = path.resolve(assetsDir, 'rollup.config.d', 'include.js'); | ||
if (fs.existsSync(includeFile)) require(includeFile)(config, {isDev}); | ||
const outputStyle = isDev ? null : 'compressed'; | ||
config.plugins.push(scss({outputStyle, sass, sourceMap: true, watch: './assets/sass'})); | ||
config.plugins.push(eslint({exclude: ['node_modules/**', '**/*.css', '**/*.sass'], fix: process.env.ESLINT_FIX ? true : false})); | ||
config.plugins.push(svelte({})); | ||
config.plugins.push(commonjs()); | ||
config.plugins.push(resolve({browser: true})); | ||
config.plugins.push(babel({babelHelpers: 'runtime'})); | ||
|
||
if (!config.output.dir && !config.output.file) config.output.file = outPath(pkg.name.replace(/\W+/g, '-') + '.[hash].js'); | ||
if (!isDev) config.plugins.push(terser()); | ||
|
||
module.exports = config; | ||
export default config; |