Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
feat: assemble inline when content is provided (#35)
Browse files Browse the repository at this point in the history
* feat: assemble inline when content is provided

* fix: convert compiled template module to iife expression

* refact: extract utility functions from assemble

* refact: always import style injector

If it is unused, it would be removed in build optimisation.

* test: add more realistic render content

* chore: add test fixtures

* feat: test assembled code in headless chrome

* fix: launch headless chrome

* chore: remove extra circle file

* fix: put chrome launch args

* chore: use puppeteer enabled image

* chore: use postcss-modules-sync instead

* feat: add validation for parameters expected in public API

fixes #31

* fix: add esModule support in custom blocks

fixes #38

* chore: rename browser to baseline test

* feat: transform srcset attribute on image to require statement

... and refactor test code
fixes #39
  • Loading branch information
znck authored Jan 13, 2018
1 parent a2bf3bb commit da252a7
Show file tree
Hide file tree
Showing 33 changed files with 1,773 additions and 502 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2
jobs:
build:
working_directory: ~/rollup-plugin-vue
working_directory: ~/project
docker:
- image: circleci/node:8.5.0
- image: alekzonder/puppeteer # base image: node/8-slim
steps:
- checkout
- run:
Expand Down
3 changes: 0 additions & 3 deletions circle.yml

This file was deleted.

9 changes: 5 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ declare module VueComponentCompiler {
plugins?: Array<object> // postcss plugins
options?: object // postcss options
onWarn?: MessageHandler
generateScopedName?: string
}

type MessageHandler = (message: Message) => void
Expand All @@ -113,7 +114,6 @@ declare module VueComponentCompiler {

type TemplateCompilerConfig = {
scopeId: string
isHot?: boolean // false
isServer?: boolean // false
isProduction?: boolean // true
esModule?: boolean // true
Expand All @@ -133,12 +133,13 @@ declare module VueComponentCompiler {

type AssemblerSource = {
script: {
id: string,
id: string?,
code: string?,
descriptor: ScriptDescriptor
}
styles: Array<{
id: string
hotPath: string
id: string?,
code: string?,
descriptor: StyleDescriptor
}>
render: {
Expand Down
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
moduleFileExtensions: [
'js',
'json',
'png',
'vue'
],
transform: {
'.*\.(js|vue|png)$': './test/setup/jest-helper.js'
},
testRegex: '.*\.spec.js'
}
Loading

0 comments on commit da252a7

Please sign in to comment.