Skip to content

Commit

Permalink
feat: add multiple webpack build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
char0n committed Feb 3, 2023
1 parent e92cc6c commit de5ce12
Show file tree
Hide file tree
Showing 8 changed files with 6,119 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# http://editorconfig.org

# A special property that should be specified at the top of the file outside of
# any sections. Set to true to stop .editor config file search on current file
root = true

[*]
# Indentation style
# Possible values - tab, space
indent_style = space

# Indentation size in single-spaced characters
# Possible values - an integer, tab
indent_size = 2

# Line ending file format
# Possible values - lf, crlf, cr
end_of_line = lf

# File character encoding
# Possible values - latin1, utf-8, utf-16be, utf-16le
charset = utf-8

# Denotes whether to trim whitespace at the end of lines
# Possible values - true, false
trim_trailing_whitespace = true

# Denotes whether file should end with a newline
# Possible values - true, false
insert_final_newline = true

[packages/apidom-ls/test/fixtures/**/*.json]
trim_trailing_whitespace = false

[packages/apidom-ls/test/fixtures/**/*.yaml]
trim_trailing_whitespace = false
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Cypress
test/cypress/screenshots
test/cypress/videos
test/cypress/downloads

# idea
*.iml
.idea

/swagger-api-swagger-editor*.tgz
11 changes: 11 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
debug: true,
useBuiltIns: false,
},
],
],
};
29 changes: 29 additions & 0 deletions config/webpack/babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const simple = {
mode: 'production',
entry: ['./src/index.js'],
target: 'web',
output: {
libraryTarget: 'umd',
library: 'ramdaTreeShaking',
},
optimization: {
minimize: true, // needs to be set to `true` for proper tree shaking
providedExports: true,
usedExports: true, // needs to be set to `true` for proper tree shaking
concatenateModules: true, // needs to be set to `true` for proper tree shaking
},
// babel has no effect on tree-shaking
module: {
rules: [
{
test: /\.(js)?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
],
},
};

module.exports = [simple];
17 changes: 17 additions & 0 deletions config/webpack/simple.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const simple = {
mode: 'production',
entry: ['./src/index.js'],
target: 'web',
output: {
libraryTarget: 'umd',
library: 'ramdaTreeShaking',
},
optimization: {
minimize: true, // needs to be set to `true` for proper tree shaking
providedExports: true,
usedExports: true, // needs to be set to `true` for proper tree shaking
concatenateModules: true, // needs to be set to `true` for proper tree shaking
},
};

module.exports = [simple];
Loading

0 comments on commit de5ce12

Please sign in to comment.