-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from jvmn/feature/2.4.0-rc
Feature/2.4.0 rc
- Loading branch information
Showing
8 changed files
with
4,103 additions
and
3,439 deletions.
There are no files selected for viewing
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,17 +1,27 @@ | ||
module.exports = function (api) { | ||
api.cache(true) | ||
const getProjectConfig = () => `${process.env.PROJECT_CWD}/project.config.js` | ||
const config = require(getProjectConfig()) | ||
const useTs = config.taskrunner.ts | ||
|
||
const presets = useTs | ||
? [ | ||
"@babel/preset-typescript", | ||
["@babel/preset-env", { useBuiltIns: "entry", corejs: "3.0" }], | ||
] | ||
: ["@babel/env"] | ||
|
||
const presets = [ | ||
["@babel/env", { | ||
// modules: false, | ||
// for uglifyjs... | ||
forceAllTransforms: process.env === "production" | ||
}], | ||
const plugins = useTs | ||
? [ | ||
"@babel/plugin-syntax-dynamic-import", | ||
"@babel/plugin-proposal-class-properties", | ||
"@babel/transform-runtime", | ||
] | ||
const plugins = [] | ||
: ["@babel/plugin-syntax-dynamic-import"] | ||
|
||
module.exports = function (api) { | ||
api.cache(true) | ||
|
||
return { | ||
presets, | ||
plugins | ||
plugins, | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* init <%= filename %> | ||
* @alias <%= filename %> | ||
* @namespace <%= namespace %> | ||
* @return {Object} <% if(js){ %>public methods and css bundle<% } %><% if (!js) { %>with css bundle<% } %> | ||
*/ | ||
<% if (js) { %> | ||
import { FrontendModuleInstance } from "../../../../types" | ||
<% } %> | ||
<% if (scss) { %> | ||
<% if (cssinjs) { %> | ||
require('./<%= filename %>.module') | ||
<% } else { %> | ||
if (process.env.NODE_ENV === 'dev') { | ||
require('./<%= filename %>.module') | ||
} | ||
<% } %> | ||
<% } %> | ||
<% if (js) { %> | ||
const <%= filename %> = (context: HTMLElement): FrontendModuleInstance => { | ||
// private functions | ||
|
||
// public functions | ||
const mod: FrontendModuleInstance = { | ||
init: function () { | ||
if (context === undefined) return | ||
|
||
context.classList.add('AP_st-init') | ||
console.log('init <%= filename %>') | ||
} | ||
} | ||
return mod | ||
} | ||
export default <%= filename %> | ||
<% } %> |
Large diffs are not rendered by default.
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
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