mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +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: {},
|
||||
stylus: {},
|
||||
ts: {
|
||||
transpileOnly: true,
|
||||
appendTsSuffixTo: [/\.vue$/]
|
||||
},
|
||||
vueStyle: {}
|
||||
},
|
||||
styleResources: {},
|
||||
|
@ -233,10 +233,7 @@ export default class WebpackBaseConfig {
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
transpileOnly: true,
|
||||
appendTsSuffixTo: [/\.vue$/]
|
||||
}
|
||||
options: this.loaders.ts
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
|
@ -80,10 +80,10 @@ describe('basic dev', () => {
|
||||
})
|
||||
|
||||
test('Config: build.loaders', () => {
|
||||
expect(Object.keys(loadersOptions)).toHaveLength(12)
|
||||
expect(Object.keys(loadersOptions)).toHaveLength(13)
|
||||
expect(loadersOptions).toHaveProperty(
|
||||
'file', 'fontUrl', 'imgUrl', 'pugPlain', 'vue',
|
||||
'css', 'cssModules', 'less', 'sass', 'scss', 'stylus', 'vueStyle'
|
||||
'css', 'cssModules', 'less', 'sass', 'scss', 'stylus', 'ts', 'vueStyle'
|
||||
)
|
||||
const { cssModules, vue } = loadersOptions
|
||||
expect(cssModules.localIdentName).toBe('[hash:base64:6]')
|
||||
|
Loading…
Reference in New Issue
Block a user