mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
feat: attach ts-loader options on build.loaders.ts (#4572)
This commit is contained in:
parent
75e3df6be5
commit
d723e49b2b
@ -43,6 +43,10 @@ export default () => ({
|
|||||||
},
|
},
|
||||||
scss: {},
|
scss: {},
|
||||||
stylus: {},
|
stylus: {},
|
||||||
|
ts: {
|
||||||
|
transpileOnly: true,
|
||||||
|
appendTsSuffixTo: [/\.vue$/]
|
||||||
|
},
|
||||||
vueStyle: {}
|
vueStyle: {}
|
||||||
},
|
},
|
||||||
styleResources: {},
|
styleResources: {},
|
||||||
|
@ -233,10 +233,7 @@ export default class WebpackBaseConfig {
|
|||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
loader: 'ts-loader',
|
loader: 'ts-loader',
|
||||||
options: {
|
options: this.loaders.ts
|
||||||
transpileOnly: true,
|
|
||||||
appendTsSuffixTo: [/\.vue$/]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
|
@ -80,10 +80,10 @@ describe('basic dev', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Config: build.loaders', () => {
|
test('Config: build.loaders', () => {
|
||||||
expect(Object.keys(loadersOptions)).toHaveLength(12)
|
expect(Object.keys(loadersOptions)).toHaveLength(13)
|
||||||
expect(loadersOptions).toHaveProperty(
|
expect(loadersOptions).toHaveProperty(
|
||||||
'file', 'fontUrl', 'imgUrl', 'pugPlain', 'vue',
|
'file', 'fontUrl', 'imgUrl', 'pugPlain', 'vue',
|
||||||
'css', 'cssModules', 'less', 'sass', 'scss', 'stylus', 'vueStyle'
|
'css', 'cssModules', 'less', 'sass', 'scss', 'stylus', 'ts', 'vueStyle'
|
||||||
)
|
)
|
||||||
const { cssModules, vue } = loadersOptions
|
const { cssModules, vue } = loadersOptions
|
||||||
expect(cssModules.localIdentName).toBe('[hash:base64:6]')
|
expect(cssModules.localIdentName).toBe('[hash:base64:6]')
|
||||||
|
Loading…
Reference in New Issue
Block a user