Class: Extension::Models::ServerConfig::DevelopmentEntries

Inherits:
Base
  • Object
show all
Includes:
SmartProperties
Defined in:
lib/project_types/extension/models/server_config/development_entries.rb

Constant Summary collapse

JAVASCRIPT =
"javascript"
JAVASCRIPT_REACT =
"javascript-react"
TYPESCRIPT =
"typescript"
TYPESCRIPT_REACT =
"typescript-react"
VALID_ENTRY_POINTS =
[
  "src/index.js",
  "src/index.jsx",
  "src/index.ts",
  "src/index.tsx",
]

Class Method Summary collapse

Methods inherited from Base

#to_h, #to_hash

Class Method Details

.find(template) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/project_types/extension/models/server_config/development_entries.rb', line 23

def self.find(template)
  case template
  when JAVASCRIPT
    new(main: "src/index.js")
  when JAVASCRIPT_REACT
    new(main: "src/index.jsx")
  when TYPESCRIPT
    new(main: "src/index.ts")
  when TYPESCRIPT_REACT
    new(main: "src/index.tsx")
  end
end